EasyManuals Logo
Home>Cisco>Network Router>ASR 9000

Cisco ASR 9000 User Manual

Cisco ASR 9000
188 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #161 background imageLoading...
Page #161 background image
A-157
Cisco ASR 9000 Series Aggregation Services Router Getting Started Guide
OL-28417-02
Chapter Understanding Regular Expressions, Special Characters, and Patterns
Parentheses Used for Pattern Recall
Parentheses Used for Pattern Recall
Use parentheses with multiple-character regular expressions to multiply the occurrence of a pattern. The
Cisco IOS XR software can remember a pattern for use elsewhere in the regular expression.
To create a regular expression that recalls a previous pattern, use parentheses to indicate memory of a
specific pattern and a double backslash (\\) followed by a digit to reuse the remembered pattern. The digit
specifies the occurrence of a parenthesis in the regular expression pattern. When there is more than one
remembered pattern in the regular expression, \\1 indicates the first remembered pattern, \\2 indicates
the second remembered pattern, and so on.
The following regular expression uses parentheses for recall:
a(.)bc(.)\\1\\2
This regular expression matches an a followed by any character (call it character number 1), followed by
bc followed by any character (character number 2), followed by character number 1 again, followed by
character number 2 again. So, the regular expression can match aZbcTZT. The software remembers that
character number 1 is Z and character number 2 is T, and then uses Z and T again later in the regular
expression.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Cisco ASR 9000 and is the answer not in the manual?

Cisco ASR 9000 Specifications

General IconGeneral
BrandCisco
ModelASR 9000
CategoryNetwork Router
LanguageEnglish

Related product manuals