20-14
Cisco ASA 5500 Series Configuration Guide using ASDM
Chapter20 Configuring Objects
Configuring Regular Expressions
Regular Expression—This area includes regular expression text that you can enter manually and build
with snippets. You can then select text in the Regular Expression field and apply a quantifier to the
selection.
Selection Occurrences—Select text in the Regular Expression field, click one of the following
options, and then click Apply to Selection. For example, if the regular expression is “test me,” and
you select “me” and apply One or more times, then the regular expression changes to “test (me)+”.
Zero or one times (?)—A quantifier that indicates that there are 0 or 1 of the previous
expression. For example, lo?se matches lse or lose.
One or more times (+)—A quantifier that indicates that there is at least 1 of the previous
expression. For example, lo+se matches lose and loose, but not lse.
Any number of times (*)—A quantifier that indicates that there are 0, 1 or any number of the
previous expression. For example, lo*se matches lse, lose, loose, etc.
At least—Repeat at least x times. For example, ab(xy){2,}z matches abxyxyz, abxyxyxyz, etc.
Exactly—Repeat exactly x times. For example, ab(xy){3}z matches abxyxyxyz.
Apply to Selection—Applies the quantifier to the selection.
Test—Tests a regular expression against some sample text.
Testing a Regular Expression
The Configuration> Global Objects > Regular Expressions > Add/Edit a Regular Expression > Test
Regular Expression dialog box lets you test input text against a regular expression to make sure it
matches as you intended.
Detailed Steps
Regular Expression—Enter the regular expression you want to test. By default, the regular
expression you entered in the Add/Edit Regular Expression or Build Regular Expression dialog box
is input into this field. If you change the regular expression during your testing, and click OK, the
changes are inherited by the Add/Edit Regular Expression or Build Regular Expression dialog
boxes. Click Cancel to dismiss your changes.
Test String—Enter a text string that you expect to match the regular expression.
Test—Tests the Text String against the Regular Expression,
Test Result—Display only. Shows if the test succeeded or failed.
Creating a Regular Expression Class Map
A regular expression class map identifies one or more regular expressions. You can use a regular
expression class map to match the content of certain traffic; for example, you can match URL strings
inside HTTP packets.
Detailed Steps
Configuration> Global Objects > Regular Expressions > Add/Edit Regular Expression Class Map
dialog box Fields: