EasyManua.ls Logo

Arris C4C - Parentheses for Recall; CLI Repeat Command

Arris C4C
3180 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 45: CLI Overview
STANDARD Revision 1.0 C4® CMTS Release 8.3 User Guide
© 2016 ARRIS Enterprises LLC. All Rights Reserved. 1121
This is another use for the ^ symbol. In this example, the following regular expression matches an input string only if the
string starts with 1234:
^1234
The next example shows that the following regular expression is a range that matches any single number, as long as it is
not the numbers 1, 2, 3, or 4:
[^1234]
Parentheses for Recall
You can use parentheses () with multiple-character regular expressions to multiply the occurrence of a pattern. You can
also use parentheses around a single or multiple-character pattern to instruct the software to remember a pattern for use
elsewhere in the regular expression.
To create a regular expression that recalls a previous pattern, you use parentheses to instruct memory of a specific pattern
and a backslash (\) followed by an integer to reuse the remembered pattern. The integer specifies the occurrence of a
parentheses in the regular expression pattern. If you have more that one remembered pattern in your regular expression,
then \1 uses the first remem\-bered pattern and \2 uses the second remembered pattern, up to nine.
The following regular expression uses parentheses for recall:
a(.)bc(.)\1\2
This regular expression matches the letter a followed by any character (call it character #1) followed by bc, followed by any
character (character #2), followed by character #1 again, followed by character #2 again. In this way, the regular
expression could match azbctzt. The software identified character #1 as z and character #2 as t and then uses z and t again
later in the regular expression.
As you will notice, the parentheses do not change the pattern; they only instruct the software to recall that part of the
matched string.
Following is an example of advanced regular expression using double parentheses:
((19.*) (slot|interface))
CLI Repeat Command
The repeat CLI command will provide a single command to allow users to repeat a show command multiple times with an
optional delay in between shows.

Table of Contents

Related product manuals