Understanding Regular Expressions; Special Characters; Multiple-Character Patterns - Cisco Nexus 5500 Series Configuration Manual

Nx-os fundamentals configuration guide, release 7.x
Hide thumbs Also See for Nexus 5500 Series:
Table of Contents

Advertisement

Understanding Regular Expressions

Understanding Regular Expressions

The Cisco NX-OS software supports regular expressions for searching and filtering in CLI output, such as
the show commands. Regular expressions are case sensitive and allow for complex matching requirements.

Special Characters

You can also use other keyboard characters (such as ! or ~) as single-character patterns, but certain keyboard
characters have special meanings when used in regular expressions.
This table lists the keyboard characters that have special meanings.
Table 9: Special Characters with Special Meaning
Character
.
*
+
?
^
$
_ (underscore)
To use these special characters as single-character patterns, remove the special meaning by preceding each
character with a backslash (\). This example contains single-character patterns that match a dollar sign ($),
an underscore (_), and a plus sign (+), respectively:
\$ \_ \+

Multiple-Character Patterns

You can also specify a pattern that contains multiple characters by joining letters, digits, or keyboard characters
that do not have special meanings. For example, a4% is a multiple-character regular expression.
With multiple-character patterns, the order is important. The regular expression a4% matches the character a
followed by a 4 followed by a percent sign (%). If the string does not have a4%, in that order, pattern matching
Cisco Nexus 5500 Series NX-OS Fundamentals Configuration Guide, Release 7.x
62
Understanding the Command-Line Interface
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.
Note
The underscore is only treated as a regular
expression for BGP related commands.
OL-30890-01

Advertisement

Table of Contents
loading

Table of Contents