What is validating information indiadating
Note that the first word boundary token appears after the optional, opening parenthesis.
This is important because there is no word boundary to be matched between two nonword characters, such as the opening parenthesis and a preceding space character.
The regexes in these recipes are all pretty straightforward, but hopefully this gives an example of the depth you can expect from the book. Both are followed by a question mark, which makes them optional.
Unless you have very specific needs that require you to filter out as many phone numbers as possible, don’t go overboard trying to eliminate unused numbers.
New area codes that fit the rules listed earlier are made available regularly, and even if a phone number is valid, that doesn’t necessarily mean it was issued or is in active use.
⋯ # [Match the remaining digits and separator.] $ # Assert position at the end of the string..
Since a question mark is used after each separator, the phone number digits are allowed to run together.