B-10
User Guide for Cisco Security MARS Local Controller
78-17020-01
Appendix B Regular Expression Reference
Vertical Bar
The "space" characters are HT (9), LF (10), VT (11), FF (12), CR (13), and space (32). Notice that this
list includes the VT character (code 11). This makes "space" different to \s, which does not include VT
(for Perl compatibility).
The name "word" is a Perl extension, and "blank" is a GNU extension from Perl 5.8. Another Perl
extension is negation, which is indicated by a ^ character after the colon. For example,
[12[:^digit:]]
matches "1", "2", or any non-digit. PCRE (and Perl) also recognize the POSIX syntax [.ch.] and [=ch=]
where "ch" is a "collating element", but these are not supported, and an error is given if they are
encountered.
In UTF-8 mode, characters with values greater than 128 do not match any of the POSIX character
classes.
Vertical Bar
Vertical bar characters are used to separate alternative patterns. For example, the pattern
gilbert|sullivan
matches either "gilbert" or "sullivan". Any number of alternatives may appear, and an empty alternative
is permitted (matching the empty string). The matching process tries each alternative in turn, from left
to right, and the first one that succeeds is used. If the alternatives are within a subpattern
(defined below),
"succeeds" means matching the rest of the main pattern as well as the alternative in the subpattern.
Internal Option Setting
The settings of the PCRE_CASELESS, PCRE_MULTILINE, PCRE_DOTALL, and
PCRE_EXTENDED options can be changed from within the pattern by a sequence of Perl option letters
enclosed between "(?" and ")". The option letters are
i for PCRE_CASELESS
m for PCRE_MULTILINE
s for PCRE_DOTALL
x for PCRE_EXTENDED
For example, (?im) sets caseless, multiline matching. It is also possible to unset these options by
preceding the letter with a hyphen, and a combined setting and unsetting such as (?im-sx), which sets
PCRE_CASELESS and PCRE_MULTILINE while unsetting PCRE_DOTALL and
PCRE_EXTENDED, is also permitted. If a letter appears both before and after the hyphen, the option is
unset.
When an option change occurs at top level (that is, not inside subpattern parentheses), the change applies
to the remainder of the pattern that follows. If the change is placed right at the start of a pattern, PCRE
extracts it into the global options (and it will therefore show up in data extracted by the
pcre_fullinfo()
function).
An option change within a subpattern affects only that part of the current pattern that follows it, so
(a(?i)b)c
Содержание CS-MARS-20-K9 - Security MARS 20
Страница 20: ...Contents xx User Guide for Cisco Security MARS Local Controller 78 17020 01 ...
Страница 356: ...17 16 User Guide for Cisco Security MARS Local Controller 78 17020 01 Chapter 17 Network Summary Summary Page ...
Страница 420: ...20 28 User Guide for Cisco Security MARS Local Controller 78 17020 01 Chapter 20 Queries and Reports Reports ...
Страница 580: ...Glossary GL 4 User Guide for Cisco Security MARS Local Controller 78 17020 01 ...