If you don't mind accepting 23,,4,5,2789 too
The match op can be used to capture and it can be used to validate. It can't always do both at the same time, and even when it can, sometimes the smart thing to do is to not care about validation.
As long as it does the right thing for proper inputs and it doesn't do anything overly bad for bad inputs, you're good.
[ I forget that too often ]
In reply to Re^2: How to consolidate regex's?
by ikegami
in thread How to consolidate regex's?
by BruceDB
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |