Validation with regular expressions: Allow two formats

Here's a nice piece of regular expression submitted by Nils that allow validation against two different formats, in this case 10 or 12 numbers:
^[0-9]{10}(?: [0-9]{2})?$

Related posts:

Comments

comments powered by Disqus