13-12
Cisco ASA 5500 Series Configuration Guide using ASDM
OL-20339-01
Chapter 13 Configuring Objects
Configuring Regular Expressions
Detailed Steps
Configuration > Global Objects > Regular Expressions > Add/Edit a Regular Expression Fields:
• Name—Enter the name of the regular expression, up to 40 characters in length.
• Value—Enter the regular expression, up to 100 characters in length. You can enter the text manually,
using the metacharacters in Table 13-1, or you can click Build to use the Building a Regular
Expression dialog box.
• Build—Helps you build a regular expression using the Building a Regular Expression dialog box.
• Test—Tests a regular expression against some sample text.
Examples
The following example creates two regular expressions for use in an inspection policy map:
regex url_example example\.com
regex url_example2 example2\.com
[a-c] Character range class Matches any character in the range. [a-z] matches any
lowercase letter. You can mix characters and ranges:
[abcq-z] matches a, b, c, q, r, s, t, u, v, w, x, y, z, and so
does [a-cq-z].
The dash (-) character is literal only if it is the last or the
first character within the brackets: [abc-] or [-abc].
“” Quotation marks Preserves trailing or leading spaces in the string. For
example, “test” preserves the leading space when it
looks for a match.
^ Caret Specifies the beginning of a line.
\ Escape character When used with a metacharacter, matches a literal
character. For example, \[ matches the left square
bracket.
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.
\xNN 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 13-1 regex Metacharacters (continued)
Character Description Notes