Table 5: Supported Regular Expression Metacharacters
(continued)
Description
Metacharacter
Matches zero or one sequence of the immediately previous character or
pattern.
?
Specifies patterns for multiple use when followed by one of the multiplier
metacharacters: asterisk (*), plus sign (+), or question mark (?).
()
Matches any enclosed character; specifies a range of single characters.
[ ]
Used within brackets to specify a range of AS or community numbers.
– (hyphen)
Matches a ^, a $, a comma, a space, a {, or a }. Placed on either side of a
string to specify a literal and disallow substring matching. Numerals enclosed
by underscores can be preceded or followed by any of the characters listed
above.
_ (underscore)
Matches characters on either side of the metacharacter; logical OR.
|
Using Metacharacters as Literal Tokens
You can remove the special meaning of a metacharacter by preceding it with a
backslash (
\
). Such a construction denotes that the metacharacter is
not
treated as a
metacharacter for that regular expression. It is simply a character or token with no
special meaning, just as a numeral has no special meaning. The backslash applies
only to the character immediately following it in the regular expression.
On an E Series router, you are likely to use the backslash only for the parentheses
characters,
(
or
)
. BGP indicates a segment of an AS path that is of type AS-confed-set
or AS-confed-seq by enclosing that segment with parentheses.
Example
The following AS-path access list uses a regular expression to match routes that have
an AS-path attribute that
begins
with any AS-confed-set or AS-confed-seq:
host1(config)#
ip as-path access-list 1 permit ^\(
The following AS-path access list uses a regular expression to match routes that have
an AS-path attribute that
ends
with any AS-confed-set or AS-confed-seq:
host1(config)#
ip as-path access-list 1 permit \)$
The following AS-path access list uses a regular expression to match routes that have
an AS-path attribute that
includes
the specific AS-confed-set or AS-confed-seq, (100
200):
host1(config)#
ip as-path access-list 1 permit \(100 200\)
46
■
Using Regular Expressions
JUNOSe 11.1.x IP Services Configuration Guide
Содержание IP SERVICES - CONFIGURATION GUIDE V 11.1.X
Страница 6: ...vi...
Страница 8: ...viii JUNOSe 11 1 x IP Services Configuration Guide...
Страница 18: ...xviii Table of Contents JUNOSe 11 1 x IP Services Configuration Guide...
Страница 20: ...xx List of Figures JUNOSe 11 1 x IP Services Configuration Guide...
Страница 22: ...xxii List of Tables JUNOSe 11 1 x IP Services Configuration Guide...
Страница 28: ...2 Chapters JUNOSe 11 1 x IP Services Configuration Guide...
Страница 138: ...112 Monitoring J Flow Statistics JUNOSe 11 1 x IP Services Configuration Guide...
Страница 286: ...260 Monitoring IP Tunnels JUNOSe 11 1 x IP Services Configuration Guide...
Страница 312: ...286 Monitoring IP Reassembly JUNOSe 11 1 x IP Services Configuration Guide...
Страница 357: ...Part 2 Index Index on page 333 Index 331...
Страница 358: ...332 Index JUNOSe 11 1 x IP Services Configuration Guide...