B-22
User Guide for Cisco Security MARS Local Controller
78-17020-01
Appendix B Regular Expression Reference
Callouts
matches "sense and sensibility" and "response and responsibility", but not "sense and responsibility". If
instead the pattern
(sens|respons)e and (?1)ibility
is used, it does match "sense and responsibility" as well as the other two strings. Such references must,
however, follow the subpattern to which they refer.
Callouts
Perl has a feature whereby using the sequence (?{...}) causes arbitrary Perl code to be obeyed in the
middle of matching a regular expression. This makes it possible, amongst other things, to extract
different substrings that match the same pair of parentheses when there is a repetition.
PCRE provides a similar feature, but of course it cannot obey arbitrary Perl code. The feature is called
"callout". The caller of PCRE provides an external function by putting its entry point in the global
variable
pcre_callout
. By default, this variable contains NULL, which disables all calling out.
Within a regular expression, (?C) indicates the points at which the external function is to be called. If
you want to identify different callout points, you can put a number less than 256 after the letter C. The
default value is zero. For example, this pattern has two callout points:
(?C1)\dabc(?C2)def
If the PCRE_AUTO_CALLOUT flag is passed to
pcre_compile()
, callouts are automatically installed
before each item in the pattern. They are all numbered 255.
During matching, when PCRE reaches a callout point (and
pcre_callout
is set), the external function is
called. It is provided with the number of the callout, the position in the pattern, and, optionally, one item
of data originally supplied by the caller of pcre_exec(). The callout function may cause matching to
proceed, to backtrack, or to fail altogether. A complete description of the interface to the callout function
is given in the
pcrecallout
documentation.
Last updated: 09 September 2004
Copyright © 1997-2004 University of Cambridge.
Содержание 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 ...