Source patterns

Pattern matching is done using enhanced regular expressions. A regular expression is a way of describing a complex pattern in a data file. Regular expressions let you search for a pattern, and if found, change it to something else. With enhanced regular expressions, you can:

  • Specify number ranges from 0 to 18446744073709551616. (You cannot use commas in the ranges.)
  • Include a range as part of a larger regular expression. The range itself can only contain numbers.
  • Use leading 0s to specify the fixed width format in value ranges. For example, [01-05] matches fixed width 2 digits valued between 1 and 5. Although the pattern does not match 1, 2, or 5, it matches 01, 02, or 05.

Expressions are not case sensitive. This table shows you how to use the syntax to create expressions:

Operators Description Example Explanation Match Examples
Literal Match the exact characters 123A Matches 123A exactly. 123A
* Select zero or more of any character. A*3 Starts with A and ends with 3, but can have any number and kind of characters in between. A1273
? One character ?BC Starts with any letter and ends with BC. ABC BBC CBC
# One digit #?C Starts with any digit followed by any letter and ends with C. 1AC 9ZC
[n-n] Range of numbers ZEE[1-128] Starts with ZEE followed by a number between 1 and 128 (inclusive). ZEE1 ZEE12 ZEE128
[A-Z] Range of letters ?*[A-C][9-99] A letter followed by anything followed by A, B or C followed by a number from 9 to 99. F12A19B98 1s3f5hC50
[ABC] Set of characters [A1F]### Matches A, 1 or F followed by a three digit number. A123 1987 F999
\ (backslash) followed by any of [ ] * ? # \ A backslash escapes special characters to suppress their special meaning. \#ABC\[? Matches #ABC[ followed by one character #ABC[X #ABC[A