Pattern matching examples

Here is a couple of examples to that will help you to better understand pattern matching:

  • _NXXXXXX – matches any seven-digit number with the first digit of 2 or greater. This pattern would match any North American Numbering Plan (NANP) local seven-digit number.
  • _9ZXXXXXXX – matches extensions with the first digit 9, followed by a number in the range of 1 to 9, and then any seven-digit number.
  • _5051. – matches any string with at least 5 characters that begins with 5051.
  • _7[1-3] – matches 71, 72, and 73.
  • _X. – matches all strings that start with a digit, followed by one or more characters.
Geek University 2022