On Sun, 27 Sep 2020, Luke Davis wrote:
Regex: \(?(\d)(\d)(\d)\)?[ \.-](\d)(\d)(\d)[ \.-](\d)(\d)(\d)(\d)
I should note, that the one case that won't handle, is:
(###)###-####
I suspect we would have to get creative to manage that one. Along the lines of:
\(?(\d)(\d)(\d)(?:\)?[ \.-]|\))(\d)(\d)(\d)[ \.-](\d)(\d)(\d)(\d)\D
I added a \D at the end to hopefully make sure we're not grabbing something that isn't a phone number.
The former expressions would have munged things like:
123-456-789090009876
(Like a serial number or tracking number or similar.)
Luke