Callouts - Cisco CS-MARS-20-K9 - Security MARS 20 User Manual

Security mars local controller
Table of Contents

Advertisement

Callouts

matches "sense and sensibility" and "response and responsibility", but not "sense and responsibility". If
instead the pattern
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:
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.
User Guide for Cisco Security MARS Local Controller
B-22
(sens|respons)e and (?1)ibility
(?C1)\dabc(?C2)def
Appendix B
Regular Expression Reference
78-17020-01

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mars 20Mars 50Mars 100Mars 200

Table of Contents