Reputation: 225
I'm trying to make a simple validation in JavaScript & PHP (for double checking) by using regex. I just want to check that the names will be allowed if there is at least two of these characters:
letters + accents + spaces + simple quotes + dash
^[aA-zZ\u00C0-\u017F- \']{2,}$
But actually, brackets are allowed in my regex pattern (don't know why), and I'd like them to be excluded, how can I do that ?
I know that \u is not allowed in PCRE-like regular expressions.
Thanks
Upvotes: 3
Views: 167
Reputation: 97672
The square brackets are between A
and z
I think you meant to have a-zA-Z
in your regex.
Upvotes: 2