phone number regex

Tony Johnson gjohnson at gs.verio.net
Sat Aug 26 11:35:43 EDT 2000


This should be fairly easy but just wanted to ask.  I have an isp phone
list file with lines formatted as such

State	City	555-555-555

I need to reformat the file.  I am trying to make a regex that will
match the phone number field.

so i try to make a regex that will match the above phone number
'[\d]+\-[\d]+\-[\d]+'  This makes the re.split function delete what
matched just like awk , etc so can i just say '(^[\d]+\-[\d]+\-[\d]+)' ?




More information about the Python-list mailing list