Go to the first, previous, next, last section, table of contents.


Input Pattern

For each pattern that matches the current mode the input pattern must match the input stream of characters for the whole pattern to match. The input pattern can consist of tokens or characters, however certain characters must be escaped and the tokens cannot be user defined. Each token generally represents a set of characters and is for convenience sake. The characters that must be escaped using a \c mechanism (or the special tokens) are left and right brackets, the bar character, and the star character. The first two are used to resolved ambiguities in priorities of operators, the bar is used to separate options, and the star is used to indicate zero or more occurences of a sequence. Note that the bar and star operators are not supported, although the bar operator can be simulated by defining multiple patterns, one for each option, like the modes. Some example input patterns are shown below.

"<dec><dec>"
"f1<new>"

The first pattern matches a sequence of characters that are two decimal digits, the second a sequence which is f1 followed by a newline. The complete set of predefined tokens is given below:

Token
Character Set
<nul>
NUL Special Character
<sot>
Start of Text (before first input character), not implemented
<eot>
End of Text (after last input character), not implemented
<sol>
Start of Line (before first input character of line), not implemented
<eol>
End of Line (after last input character of line), not implemented
<spc>
" "
<tab>
"\t"
<wht>
" \t"
<new>
"\n"
<car>
"\r"
<del>
" \t"
<abc>
"abcdefghijklmnopqrstuvwxyz"
<ABC>
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
<dec>
"0123456789"
<hex>
"0123456789abcdef"
<HEX>
"0123456789ABCDEF"
<sym>
"!\"#$%&'()*+,-./:;<=>?@[\]^_`{|}~"
<any>
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ \t"
<all>
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ \t\n\r"
<bar>
"|"
<not>
"!"
<mul>
"*"
<lbr>
"("
<rbr>
")"

The <nul> token is special because it effectively matches any character, but when it does the matching character is left on the input stream. So for example the patterns <nul>A and A both match A on the input stream. The <nul> pattern has a lower matching priority though as a more specific match is preferred over a more general one. If more than one input pattern matches the input stream, the longer match is preferred. For example if the input stream had ABC then the patterns A, AB, and ABC could all match, but the last would be chosen. If two patterns match and are the same length then the earlier one (in the order the patterns were defined) is chosen.


Go to the first, previous, next, last section, table of contents.