|
|
|
NOTE: This Design document is subject to change at any time. |
Regular expression support in zApp is provided by the PCRE library package, which is open source software, written by Philip Hazel, and copyright by the University of Cambridge, England. http://www.pcre.org/.
The following regular expression patterns are supported:
. match any single character
* match zero or more of the previous pattern
+ match one or more of the previous pattern
? match zero or one of the previous pattern
(exp) group the regular expression "exp" into a single pattern. The matching subpattern is stored in the \1..\99 variables for use in the replacement string of the RegReplace function.
(?:exp) group the regular expression as above, but do NOT store the value in the \1..\99 variables.
exp1 | exp2 match expression exp1 OR expression exp2. Any number of expressions can be listed, separated by |
[abc] match a range of letters. In this case, the letters a, b, or c are matched. You can specify a range of characters using the - operator. For example [a-z] matches any lowercase character. Putting ^ before the range defines a range of characters that are excluded. For example [^a-z] matches anything *except* a lowercase character.
^ matches the beginning of line
$ matches the end of the line
\ escapes the next character, matching that character verbatim. For example \* matches an asterisk. \\ matches a slash itself.
\s a space character (ascii 32)
\S matches any non-whitespace
\p the | pipe character
\w a word character (matches a-zA-Z0-9)
\W matches any non-word character
\a a letter (matches a-zA-Z)
\d a digit (matches 0-9)
\D matches any non-digit
\h a hex character (0-9A-F)
\n matched a newline for multiline triggers
\b matches a word boundry (zero-length match)
\B matches a non-word boundry (zero-length match)
\A matches only the beginning of the string
\Z matches only the end of the string or before a newline at the end
\z matches only the end of the string
For additional help on Perl Regular Expressions, go to http://www.perldoc.com/perl5.6/pod/perlre.html |
|