The following table lists sample subpatterns (that are also a part of the product). Included for each subpattern is a description, a matching subpattern expression, matching text examples, and nonmatching text examples. This information will help you understand how to construct new subpatterns or use existing subpatterns when you create a new data pattern.
Viewing assistance
Subpattern name | Description | Subpattern expression | Matching text examples | Nonmatching text examples |
---|---|---|---|---|
AlphaNumeric | Matches alphanumeric text and skips any special characters | [A-Za-z0-9]* |
| Any text that contains special characters: ~! @ # $ % ^ & * ( ) _ - + = { } [ ] : ” ; ' | \ < > , . ? / |
Valid email address | [a-zA-Z0-9._%-]+@ |
|
| |
Int | An integer, optionally prefixed with a plus or minus sign | (?:[+-]?(?:[0-9]+)) |
|
|
Base10Num | Positive and negative decimal numbers | (?<![0-9.+-])(?>[+-]? |
| Any string other than that mentioned in the matching examples |
Base16Num | Number in base-16 format | (?<![0-9A-Fa-f])(?:[+-]? | Any positive or negative numbers:
|
|
Base16Float | Float number in base-16 format | \b(?<![0-9A-Fa-f.]) |
|
|
PosInt | A positive integer with no plus or minus sign | \b(?:[0-9]+)\b |
|
|
TwoDigitInt | Two-digit integer with no plus or minus sign | [0-9]{2} |
|
|
CiscoMacAddress | Cisco MAC address | (?:(?:[A-Fa-f0-9] |
|
|
WindowsMacAddress | Windows mac address | (?:(?:[A-Fa-f0-9]{2}-) |
|
|
CommonMac | Common MAC address | (?:(?:[A-Fa-f0-9] |
|
|
MacAddress | Cisco, Windows, or common MAC address of a machine | (?:%{CiscoMacAddress}| | Any string that matches:
| Any string that does not match one of the supported MAC addresses |
Ip | IP address of a machine | (?<![0-9]) |
| Any string other than those listed in the matching examples |
HostName | Name of the machine | \b(?:[0-9A-Za-z] |
| Any string starting with special characters |
IpV6 | IPV6 address of the machine | (?:[0-9a-fA-F]{1,4}:) | fe80::2ed4:44ff: feb5:8ec1 | Not applicable |
IpOrHost | Valid host name, IP address, or IPv6 address | (?:%{HostName}| |
| Not applicable |
UnixFilePath | File path on a UNIX machine | (?<![\w\\/]) |
|
|
WindowsFilePath | File path on a Windows machine | (?:[A-Za-z]+:|\\) |
| shared |
FilePath | UNIX or Windows file path | (?:%{UnixFilePath}|
| All samples shown for Examples:
| Not applicable |
Month | Calendar month in short form (first three letters) or full form | \b(?:Jan(?:uary)?| |
| Any string other than those listed in the matching examples |
MonthNum | Calendar month in numbers, where 1 is January and 12 is December | (?: 0 ?[ 1 - 9 ]| 1 [ 0 - 2 ]) |
| Any string other than those listed in the matching examples |
MonthDay | Day of the month as a number | %{DigitDay} |
| Any string other than those listed in the matching examples |
Day | Day of the week in short form (first three letters) or full form | (?:Mon(?:day)? |
| Any string other than those listed in the matching examples |
DigitDay | Day of the month as a number | (?:\s[1-9]|[1-9]| |
| Any string other than those listed in the matching examples |
FullYear | Year in numbers, in 4-digit representation | [1-9][0-9]{3} | 1000 through 9999 | Any string other than those listed in the matching examples |
Hour | Hour in both 12-hour and 24-hour format Handles both single-digit and double-digit representation | (?:2[0123]| |
| Any string other than those listed in the matching examples |
Minute | Minutes in the hour Handles double-digit representation only | (?:[0-5][0-9]) | 00 through 59 | Any string other than those listed in the matching examples |
Second | Seconds in the minute Also capable of handing milliseconds | (?:(?:[0-5][0-9]|60) |
| Any string other than those listed in the matching examples |
Time | Time of the day in hours, minutes, seconds, and milliseconds format | (?!<[0-9])%{Hour}: | Not applicable | Not applicable |
Tz | Time zone in short form | (?:[PMCE][SD]T) |
| Any string other than those listed in the matching examples |
Timezone | Time zone in short form, numbers, and so on This regular expression is intentionally made more flexible than required | [A-Za-z]{3}| |
| Any string other than those listed in the matching examples |
Data | Matches any string. It is very useful to capture a dynamic list of inputs for a field; when you are not aware of all the possible values of the field. BMC recommends you to use this subpattern when the string for which the field is being captured is succeeded by a clear delimiter. Note: The field value must not contain the delimiter. | .*? | Any string succeeded by a clear delimiter including alpha-numeric characters and special characters In the following example, you can use this subpattern to capture the string "DEBUG" where space ( ) appearing after the string acts as a delimiter.
| Any string which is not succeeded by a clear delimiter or a string that contains the same character that you want to use as a delimiter In the following example, if you want to capture the string "queue count" using space ( ) as the delimiter, then this subpattern must not be used.
|