j00b
j00b

Reputation: 103

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 upper case letters

Upvotes: 8

Views: 29965

Answers (3)

Nitesh
Nitesh

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

CanSpice
CanSpice

Reputation: 35818

/^[0-9A-Za-z!@.,;:'"?-]{1,100}\z/

Upvotes: 9

MByD
MByD

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

Related Questions