text: #!/usr/bin/env python3
  
  
  # Exercise from `Automate the boring stuff with Python`
  
  import pyperclip
  import re
  
  phoneRegex = re.compile(
      r"""(
      (\d{3}|\(\d{3}\))?                # area code
      (\s|-|\.)?                        # separator
      (\d{3})                           # first 3 digits
      (\s|-|\.)                         # separator
      (\d{4})                           # last 4 digits
      (\s*(ext|x|ext.)\s*(\d{2,5}))?    # extension
      )""",
      re.VERBOSE,
  )
  