Cisco Catalyst 4500 Series Command Reference Manual page 55

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

Advertisement

Chapter 1
Command-Line Interface
You can create a multiple-character regular expression containing all letters, all digits, all keyboard
characters, or a combination of letters, digits, and other keyboard characters. These examples are all
valid regular expressions:
telebit 3107 v32bis
Multipliers
You can create more complex regular expressions to match multiple occurrences of a specified regular
expression by using some special characters with your single- and multiple-character patterns.
lists the special characters that specify "multiples" of a regular expression.
Table 1-5
Character
*
+
?
This example matches any number of occurrences of the letter a, including none:
a*
This pattern requires that at least one letter a in the string is matched:
a+
This pattern matches the string bb or bab:
ba?b
This string matches any number of asterisks (*):
\**
To use multipliers with multiple-character patterns, you enclose the pattern in parentheses. In the
following example, the pattern matches any number of the multiple-character string ab:
(ab)*
As a more complex example, this pattern matches one or more instances of alphanumeric pairs (but not
none; that is, an empty string is not a match):
([A-Za-z][0-9])+
The order for matches using multipliers (*, +, or ?) is to put the longest construct first. Nested constructs
are matched from outside to inside. Concatenated constructs are matched beginning at the left side of
the construct. Thus, the regular expression matches A9b3, but not 9Ab3 because the letters are specified
before the numbers.
OL-25342 -01
Special Characters Used as Multipliers
Description
Matches 0 or more single- or multiple-character patterns.
Matches 1 or more single- or multiple-character patterns.
Matches 0 or 1 occurrences of the single- or multiple-character patterns.
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-5
1-9

Advertisement

Table of Contents
loading

Table of Contents