Regular Expression to limit all letters less than 100 characters
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 uppe开发者_运维技巧r case letters
^(.{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
/^[0-9A-Za-z!@.,;:'"?-]{1,100}\z/
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
精彩评论