Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8091631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:06:29+00:00 2026-06-05T20:06:29+00:00

I am limiting my input to only accept this characters: apostrophe ‘ open parenthesis

  • 0

I am limiting my input to only accept this characters:

  • apostrophe ‘
  • open parenthesis (
  • close parenthesis )
  • comma ,
  • hyphen –
  • period .
  • alphanumeric A-Z a-z 0-9
  • space

I come up with this regex:

/^['(),-.A-Za-z0-9\s]+$/

Do I violate any regularization order in here? I just want to have the order of regex based on order I stated on the bullets above.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T20:06:30+00:00Added an answer on June 5, 2026 at 8:06 pm

    Tweaking the regex in the question comment by @Mark Linus:

    /^[-'(),.\w\s]+$/ (moving the hyphen to the beginning of the character class)

    The reason: In a regex character class, - Specifies a range of characters, unless it’s the first or the last character.

    ,-. means any characters from , to . inclusive. As it happens, - is the single character between those two (based on ASCII value), so it works out the same in this case. But it’s probably not a good idea to put a hyphen anywhere in a character class except the beginning or the end unless you mean for it to specify a range.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this little credit card validation program where the user has to input
It is possible to limiting QuerySet in this kind of way: creators_list = ['jane',
I know that ES_NUMBER exists to limit CreateWindowEx to numeric input only, is there
Is there a canonical solution for limiting the number of characters that someone can
This is a general question about how limiting are web development frameworks such as
Possible Duplicate: python limiting floats to two decimal points If I make this: 12.45-12
Is there any way in Mustache of limiting the number of characters a Mustache
Possible Duplicate: Limiting the dates within a C# win form DateTimePicker in C#, is
I am looking at ways of limiting data (pages) visible to users based on
I am trying to improve performance by limiting my objects in memory by using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.