Next: Rewrite Built-in Functions, Previous: ‘delete’ statement, Up: Full Syntax Description [Contents][Index]
Rewrite uses POSIX regular expressions (See Regular Expression Library in Regular Expression Library, for the detailed description of these).
You control the exact type of regular expressions by the use of the
pragmatic comment regex. Its syntax is as follows:
#pragma regex option-list
Option-list is a whitespace-separated list of options. Each option is one of the following words prefixed with ‘+’ or ‘-’:
extendedUse POSIX extended regular expression syntax when interpreting regular expressions.
icaseDo not differentiate case. Subsequent regular expression comparisons will be case insensitive.
newlineMatch-any-character operators don’t match a newline.
A non-matching list (‘[^...]’) not containing a newline does not match a newline.
Match-beginning-of-line operator (‘^’) matches the empty string immediately after a newline.
Match-end-of-line operator (‘$’) matches the empty string immediately before a newline.
Prefixing an option with ‘+’ means to enable the corresponding behavior. Prefixing it with ‘-’ means to disable it. Thus, the following statement:
#pragma regex +extended +icase
will enable extended POSIX regular expressions using case-insensitive comparison.
Using the following comment:
#pragma regex -extended
will switch to the basic POSIX regular expressions.
The settings of a regex pragmatic comment remain in force up to
the end of current source file, or to the next regex comment,
whichever occurs first.
For compatibility with previous versions, GNU Radius uses the following defaults:
#pragma regex -extended -icase -newline
i.e. all regular expressions are treated as basic POSIX, comparison is case-sensitive.
Next: Rewrite Built-in Functions, Previous: ‘delete’ statement, Up: Full Syntax Description [Contents][Index]