Here are some of the regex expressions that I’ve found useful. The first is just for US phone numbers. I’ve modified one that I found so that it is a little more restrictive, specifically not allowing zeros or ones for the first digit of the area code or the central office code.
Here’s how to format it:
I’ve also used https://regex101.com/ for testing and decoding them.
Leave a Comment