Reputation: 103
I need the regular expression that would limit the number of characters to 100 and allow the use of 0-9, !@.,;:'"?- and all lower and upper case letters
Upvotes: 8
Views: 29965
Reputation: 147
^(.{1,100})$
.
This will allow all the characters numbers and special characters also
{1,100}
this the range you need to specific like min and max count
Upvotes: 13
Reputation: 137382
Depends on the language, but should be
^[0-9A-Za-z!@\.;:'"?-]{1,100}$
As pointed out in comments, and just to avoid usage of bad example:
^[0-9A-Za-z!@.,;:'"?-]{1,100}\z
Upvotes: 5