in reply to Simple Regex
One way to do it is to eliminate all of your problem characters first. This way, you won't have to think through a more complex RE:
Of course, this assumes that all phone numbers have the correct numbers in all the right places (three digit area code, seven digit number, and possibly an extension). It'll probably be right for a good number of rows, but the only way to be sure is to eyeball the output and compare it.
Hope this helps!
--jwest
s/\D//g; /(\d{10})(\d*)/;
Of course, this assumes that all phone numbers have the correct numbers in all the right places (three digit area code, seven digit number, and possibly an extension). It'll probably be right for a good number of rows, but the only way to be sure is to eyeball the output and compare it.
Hope this helps!
--jwest
-><- -><- -><- -><- -><- All things are Perfect To every last Flaw And bound in accord With Eris's Law - HBT; The Book of Advice, 1:7
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Simple Regex
by tjh (Curate) on Apr 08, 2002 at 17:32 UTC |
In Section
Seekers of Perl Wisdom