I'm trying to reformat phone numbers across multiple text files. The phone numbers are in the format: (###) ###-#### and I would like them in the format: ##########
I can isolate the phone number(s) with the following "find" string: \([0-9]?[0-9]?[0-9]\) [0-9]?[0-9]?[0-9]-[0-9]?[0-9]?[0-9]?[0-9]?[0-9]
Is there a way to "replace" just the numbers in the text file?
Thanks for your help,
Aaron
Formatting phone number
It's just a matter of setting up 'capturing' groups using brackets in the expression, then referencing them in the replace string using $groupno -
ie
Regex: \(([0-9]?[0-9]?[0-9])\) ([0-9]?[0-9]?[0-9])-([0-9]?[0-9]?[0-9]?[0-9]?[0-9])
Replace: $1$2$3
This should do it.
Edit: Just posted this then saw your response. Glad you like TC.
ie
Regex: \(([0-9]?[0-9]?[0-9])\) ([0-9]?[0-9]?[0-9])-([0-9]?[0-9]?[0-9]?[0-9]?[0-9])
Replace: $1$2$3
This should do it.
Edit: Just posted this then saw your response. Glad you like TC.