Reputation: 6998
I can't figure out why this regex pattern isn't accepting numbers? It used to but then I added [()#'/- part and it stopped.
^[()#'/-0-9A-Za-z ]+$
Upvotes: 1
Views: 43
Reputation: 626845
The /-0
created a valid range that only matches /
or 0
:
So, your regex could match a string with 0
and 9
in it (like ()#'/0-9ABCZab c
), but not the whole digit range.
Replace with
^[-()#'/0-9A-Za-z ]+$
See the regex demo
Upvotes: 2