Tyler Matema
Tyler Matema

Reputation: 67

Regular expression, alphanumeric, few special character and no others

First of all pardon me with my English grammar. Anyway, I am trying to create a regular expression which contains alpha numeric characters including spaces, comma, full stop, exclamation point and question mark, but other characters and symbols are not allowed.

Would this regular expression work?

'/[^a-zA-Z\s,!?]$'

Thank you so much for the help

Upvotes: 1

Views: 3777

Answers (1)

Karol Wypchło
Karol Wypchło

Reputation: 68

try this one /^[a-zA-Z0-9\s\.,!?]*$/

Upvotes: 4

Related Questions