Appendix F: Syntax and Format Reference

Regular Expression Syntax

Several transformation patterns allow using Regular Expressions to define the textual pattern we want to find in the host screen.

General Examples

Expression Search for
Just some text Specific text, find only "Just some text"
.*\.txt Text files, like "Readme.txt"
Gr[ae]y Only "Gray" or "Grey"
Colou?r Only "Color" or "Colour"
\b[1-9][0-9]{2,4}\b A number between 100 and 99999
\b[A-Z0-9._%-]+@ [A-Z0-9.-]+\.[A-Z]{2,4}\b Email address, like "help@softwareag.com"

Host Specific Examples

Search for Use... Expression
"1 more >" or "2 more >" To convert the text "1 more >" or "2 more >" etc. to a button that sends PF11 [1-9] more >
"(x-y)", "(January-march)", etc. To erase any text with this pattern \(.*-.*\)

General Rules

  • [|] separates alternatives.

  • Expressions within parentheses are matched as subpattern groups and saved for further use.

  • By default, a quantified subpattern matches as many times as possible without causing the rest of the pattern not to match. To change the quantifiers to match the minimum number of times possible, without causing the rest of the pattern not to match, use a [?] right after the quantifier.

Regular Expression Matching

Expression Matches
{n,m} At least n but not more than m times
{n,} At least n times
{n} Exactly n times
* 0 or more times
+ 1 or more times
? 0 or 1 time
. Everything except \n in a regular expression within parentheses
^ A null token matching the beginning of a string or line (i.e., the position right after a new line or right before the beginning of a string) in a regular expression within parentheses
$ A null token matching the end of a string or line (that is, the position right before a new line or right after the end of a string) in a regular expression within parentheses
\b Backspace inside a character class ([abcd])
\b Null token matching a word boundary (\w on one side and \W on the other)
\B Null token matching a boundary that isn't a word boundary
\A Only at the beginning of a string
\Z Only at the end of a string (or before a new line at the end)
\ New line
\r Carriage return
\t Tab
\f Form feed
\d Digit [0-9]
\D Non-digit [^0-9]
\w Word character [0-9a-z_A-Z]
\W Non-word character [^0-9a-z_A-Z]
\s A white space character [ \t\n\r\f]
\S A non-white space character [^ \t\n\r\f]
\xnn The hexadecimal representation of character nn
\cD The corresponding control character
\nn or \nnn The octal representation of character nn unless a back reference.
\1, \2, \3 ... Whatever the first, second, third, and so on, parenthesized group matched. This is called a back reference. If there is no corresponding group, the number is interpreted as an octal representation of a character.
\0 The null character. Any other back-slashed character matches itself.
*? 0 or more times
+? 1 or more times
?? 0 or 1 time
{n}? Exactly n times
{n,}? At least n times
{n,m}? At least n but not more than m times