Regular Expressions - Cisco Catalyst 4500 Series Command Reference Manual

Cisco ios command reference
Hide thumbs Also See for Catalyst 4500 Series:
Table of Contents

Advertisement

Chapter 1
Command-Line Interface
You can perform three types of filtering:
You can then search this filtered output at the --More-- prompts.
Note
The CLI string search function does not allow you to search or filter backward through previous output;
filtering cannot be specified using HTTP access to the CLI.

Regular Expressions

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-Character Patterns
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-character pattern. You can
also use other keyboard characters (such as ! or ~) as single-character patterns, but certain keyboard
characters have special meaning when used in regular expressions.
characters that have special meaning.
Table 1-4
Character
.
*
+
?
^
$
_ (underscore)
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, respectively.
\$ \_ \+
OL-25342 -01
Use the begin keyword to begin output with the line that contains 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 regular expression.
Characters with Special Meaning
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.
Matches a comma (,), left brace ({), right brace (}), left parenthesis ( ( ),
right parenthesis ( ) ), the beginning of the string, the end of the string, or a
space.
Catalyst 4500 Series Switch Cisco IOS Command Reference—Release IOS XE 3.3.0SG and IOS 15.1(1)SG)
Using the CLI String Search
Table 1-4
lists the keyboard
1-7

Advertisement

Table of Contents
loading

Table of Contents