Huawei AR2200 Series Configuration Manual page 26

Enterprise routers
Hide thumbs Also See for AR2200 Series:
Table of Contents

Advertisement

Huawei AR2200 Series Enterprise Routers
Configuration Guide - Basic Configuration
Formal Language Theory of the Regular Expression
The regular expression consists of common characters and particular characters.
l
l
Issue 02 (2011-10-15)
Common characters
Common characters are used to match themselves in a string, including all upper-case and
lower-case letters, digits, punctuation, and special symbols. For example, a matches the
letter "a" in "abc", 202 matches the digit "202" in "202.113.25.155", and @ matches the
symbol "@" in "xxx@xxx.com".
Particular characters
Particular characters are used together with common characters to match the complex or
particular string combination.
Table 2-5 Description of particular characters
Particul
Syntax
ar
characte
r
\
Defines an escape character, which
is used to mark the next character
(common or particular) as the
common character.
^
Matches the starting position of the
string.
$
Matches the ending position of the
string.
*
Matches the preceding element zero
or more times.
+
Matches the preceding element one
or more times
?
Matches the preceding element zero
or one time.
.
Matches any single character.
()
Defines a subexpression, which can
be null. Both the expression and the
subexpression should be matched.
Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.
Table 2-5
describes particular characters and their syntax.
Example
\* matches "*".
^10 matches "10.10.10.1" instead of
"20.10.10.1".
1$ matches "10.10.10.1" instead of
"10.10.10.2".
10* matches "1", "10", "100", and
"1000".
(10)* matches "null", "10", "1010",
and "101010".
10+ matches "10", "100", and
"1000".
(10)+ matches "10", "1010", and
"101010".
10? matches "1" and "10".
(10)? matches "null" and "10".
0.0 matches "0x0" and "020".
.oo matches "book", "look", and
"tool".
100(200)+ matches "100200" and
"100200200".
2 CLI Overview
15

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents