I have a validation expression that doesn't accept the @ character and can't be all numbers:
First part: accept 0 or more non-@ chars
Second part: accept 1 or more non-@ and non-numeric chars (guarantees no pure-numeric inputs)
Third part: accept 0 or more non-@ chars
^(?#Exclude @)([^@]*)(?#Exclude @ AND NUM)([^@0-9]+)(?#Exclude @)([^@]*)$
Is there a way to also restrict total length of the expression: i.e. input of length more than 10 is invalid? Or is there a good way to rewrite my expression so I can just use {1,10}?
Thanks
Start Free Trial