![Huawei Quidway NetEngine80 Configuration Manual Download Page 58](http://html.mh-extra.com/html/huawei/quidway-netengine80/quidway-netengine80_configuration-manual_169456058.webp)
Quidway NetEngine80
Configuration Guide - Basic Configurations
3 CLI Overview
Issue 04 (2009-12-20)
Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.
3-9
The regular expression is a tool for matching and replacing modes. Users should construct the
matching mode based on certain rules, and then match the mode with the target object.
To help users construct the matching mode flexibly, regular expressions provide some special
characters that are called metacharacters. Metacharacters are used to define the modes of
other characters in the target object.
Metacharacters are described in
Table 3-5
.
Table 3-5
Describes metacharacters
Metacharacter
Connotation
\ Escape
character
.
Matches any single character including space except for \n.
*
Characters on the left of it appear for 0 or many times continuously
in the target object.
+
Characters on the left of it appear for 1 or many times continuously
in the target object.
|
Or relationship exists between characters on the left and right
sides of it.
^
Characters on the right of it must appear at the beginning of the
target object.
$
Characters on the left of it must appear at the end of the target
object.
[xyz]
Matches the character listed in the square character.
[^xyz]
Matches any character that is not listed in the square bracket (^ is on
the left of the character).
[a-z]
Matches any character within the specified range.
[^a-z]
Matches any character that is not within the specified range.
{n}
The matches appear for n times (n is a non-negative integer).
{n,}
The matches appear for at least n times (n is a non-negative integer).
{n,m}
The matches appear for n-m times (m and n are non-negative
integer and n is smaller than or equal to m).
Note that there is no space between n and m.
For example:
^ip: matches the target object that begins with the character string "ip".
ip$: matches the target object that ends with the character string "ip".
The simplest regular expressions do not contain any metacharacter. For example, when a
regular expression is defined as "hello", it matches only the character string "hello".
NE80 supports two ways of applying regular expression in filtering.