Specifications

1-7
Catalyst 4500 Series Switch Cisco IOS Command Reference—Release IOS XE 3.5(0)XO
OL_28738-01
Chapter 1 Command-Line Interface
Using the CLI String Search
You can perform three types of filtering:
Use the begin keyword to begi n output with the line that co ntains a specified regular expression.
Use the include keyword to include output lines that contain a specified regular expression.
Use the exclude keyword to exclude output lines that contain a specified regula r expression.
You can then search this filtered output at the --More-- prompts.
Note The CLI string search fun ction doe s not al low you to search or filter backward through previous output ;
filtering cannot be specified using HTTP access t o the CLI.
Regular Expr essions
A regular expression can be a single character that matches the same single character in the command
output or multiple characters that match the same multiple characters in the command output. This
section describes how to create both single-character patterns and multiple-character patterns and how
to create more complex regular expressions using multipliers, alternation, anchoring, and parentheses.
Single- Charac ter Pa tterns
The simplest regular expression is a single character that matches the same single character in the
command output. You can use any letter (A-Z, a-z) or digit (0-9) as a single-char acter pattern. You can
also use other keyboard characters (such as ! or ~) as single-chara cter patterns, but certa in keyboard
characters have special meaning when used in regular expressions. Table 1-4 lists the keyboard
characters that have special meaning.
To enter these special characters as single-character patterns, remove the special meaning by preceding
each character with a backslash (\). These examples are single-character patterns matching a dollar sign,
an underscore, and a plus sign, respe ctively.
\$ \_ \+
Table 1-4 Characters with Special Meaning
Character Special Meaning
. Matches any single character, including white space.
* Matches 0 or more sequences of the pattern.
+ Matches 1 or more sequences of the pattern.
? Matches 0 or 1 occurrences of the pattern.
^ Matches the beginning of the string.
$ Matches the end of the string.
_ (underscore) Matches a comma (,), left brace ({), right brace (}), left parenthesis ( ( ),
right parenthesis ( ) ), the begi nning of the string, the end of the strin g, or a
space.