matches detects samples that contain a Regular Expression. Regular Expressions are a way of describing blocks of text. Here are some examples of regular expressions:
Expression | Description | Matching examples |
xzy | matches the literal text “xyz” | xyz |
[a-z]{2} | two letters together | ab, aA, AZ |
[a-z]{2,4} | two, three or four letters together | ab, aaab, aZc |
[a-c][0-9]{3} | the letters a, b or c followed by three digits | a111, b345, c220 |
[0-9]{2}[a-z]+[0-9]{3} | two digits followed by at least one letter followed by 3 digits | 12a899, 31ppad904 |
[0-9]{2}[a-z]*[0-9]{3} | two digits followed by any number (including zero) of letters followed by 3 digits | 12345, 12c345, 12ccccc345 |
matches evaluates as True if a block of text matching the expression is found in the sample value.
For example, given the following case fragment,
ReqDrDetail 8912373a ReqDrAddress 123 Canberra St Sydney
ReqDrDetail matches “[0-9]{7}[A-Z]{1}”
ReqDrAddress matches “Canberra”
See also exactly matches which allows for more precise conditions. To illustrate the difference, consider the further examples:
ReqDrAddress matches “Sydney”
Not ReqDrAddress exactly matches “Sydney”
ReqDrAddress exactly matches “123 Canberra St Sydney“
For more information on Regular Expressions, contact your system administrator or PKS.