The recipes further down in this chapter will surely teach you something new, unless you have already read by Jeffrey E. Together, they form a comprehensive tutorial to regular expressions.
Read it from start to finish to get a firm grasp of regular expressions.
The first 3 numbers are assigned to individual states, territories, or groups of people. (Although, technically, a lot of those upper numbers haven't been used yet.
Or dive right in to the real-world regular expressions in Chapters 4 through 8, and follow the references back to this chapter whenever those chapters use some syntax you’re not familiar with.
This tutorial chapter deals with regular expressions only and completely ignores any programming considerations.
You could try to match for an extension, but there's no requirement for a file to have an extension.
There are probably dozens of way to format a phone number.