I've been working on my own phone number extraction snippet of Regex code and I'd appreciate your feedback on it. I've tried to make it match as many different types of numbers as I knew existed in the US. (I'm sure there's some I missed.) Is there anything I can do to improve this?
(?:\+?(\d{1})?-?\(?(\d{3})\)?[\s-\.]?)?(\d{3})[\s-\.]?(\d{4})[\s-\.]?
Here's a picture of it in action:
You can test the code out here.
Also for this interested, here is the flow of the "logic":
(Made from pasting the code into here)
'1-800)-123-4567'
, which may be undesirable \$\endgroup\$