
20-13
Catalyst 6500 Series Switch and Cisco 7600 Series Router Firewall Services Module Configuration Guide using ASDM
OL-20748-01
Chapter 20 Using Modular Policy Framework
Configuring Special Actions for Application Inspections (Inspection Policy Map)
To test and create a regular expression, perform the following steps:
Step 1
To test a regular expression to make sure it matches what you think it will match, enter the following
command:
hostname(config)#
test
regex
input_text regular_expression
Where the
input_text
argument is a string you want to match using the regular expression, up to 201
characters in length.
The
regular_expression
argument can be up to 100 characters in length.
Use
Ctrl+V
to escape all of the special characters in the CLI. For example, to enter a tab in the input
text in the
test regex
command, you must enter
test regex "test[Ctrl+V Tab]" "test\t"
.
If the regular expression matches the input text, you see the following message:
INFO: Regular expression match succeeded.
If the regular expression does not match the input text, you see the following message:
INFO: Regular expression match failed.
Step 2
To add a regular expression after you tested it, enter the following command:
hostname(config)#
regex
name regular_expression
Where the
name
argument can be up to 40 characters in length.
The
regular_expression
argument can be up to 100 characters in length.
The following example creates two regular expressions for use in an inspection policy map:
hostname(config)#
regex url_example example\.com
hostname(config)#
regex url_example2 example2\.com
char
Character
When character is not a metacharacter, matches the
literal character.
\r
Carriage return
Matches a carriage return 0x0d.
\n
Newline
Matches a new line 0x0a.
\t
Tab
Matches a tab 0x09.
\f
Formfeed
Matches a form feed 0x0c.
\x
NN
Escaped hexadecimal number
Matches an ASCII character using hexadecimal (exactly
two digits).
\
NNN
Escaped octal number
Matches an ASCII character as octal (exactly three
digits). For example, the character 040 represents a
space.
Table 20-1
regex Metacharacters (continued)
Character Description
Notes
Summary of Contents for 6500 - Catalyst Series 10 Gigabit EN Interface Module Expansion
Page 35: ...P A R T 1 Getting Started and General Information ...
Page 36: ......
Page 297: ...P A R T 2 Configuring the Security Policy ...
Page 298: ......
Page 521: ...P A R T 3 System Administration ...
Page 522: ......
Page 613: ...P A R T 4 Reference ...
Page 614: ......