I haven't tested it, but it should allow:$number =~ /^\s*(\(\d{3}[)\-]\s*)?\d{3}\-?\d{4}(\s*ext[\.\:]?\s*\d+)?\ +s*$/i
(123) 123-1234
(123)123-3456
1234567890
(123) 456-9876 ext 345
(456-6789 Ext. 5567894
In reply to Re: Tweak for my Perl Regex that screens for digits only
by stony
in thread Tweak for my Perl Regex that screens for digits only
by hackermike
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |