Re: Pronunciation of phone numbers


Luke Davis
 

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

Join nvda@nvda.groups.io to automatically receive all group messages.