Reputation: 1495
What is the correct regular expression to match only number, parentheses, plus and minus signs?
I've spent a long time on http://rubular.com/ and I came up with this for matching numbers only:
/\A[^a-zA-Z]*\z/
How can I do this so that it also matches for parentheses, plus and minus signs?
Upvotes: 1
Views: 74