Table 5: Supported Regular Expression Metacharacters
(continued)
Description
Metacharacter
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\)
Regular Expression Examples
Table 6 on page 45 lists some representative regular expressions that you might use in
an AS-path access list or community list, along with sample attribute values that match
or do not match the regular expression.
Copyright © 2010, Juniper Networks, Inc.
44
JunosE 11.2.x IP Services Configuration Guide
Содержание JUNOSE 11.2.X IP SERVICES
Страница 6: ...Copyright 2010 Juniper Networks Inc vi...
Страница 8: ...Copyright 2010 Juniper Networks Inc viii JunosE 11 2 x IP Services Configuration Guide...
Страница 18: ...Copyright 2010 Juniper Networks Inc xviii JunosE 11 2 x IP Services Configuration Guide...
Страница 22: ...Copyright 2010 Juniper Networks Inc xxii JunosE 11 2 x IP Services Configuration Guide...
Страница 28: ...Copyright 2010 Juniper Networks Inc 2 JunosE 11 2 x IP Services Configuration Guide...
Страница 116: ...Copyright 2010 Juniper Networks Inc 90 JunosE 11 2 x IP Services Configuration Guide...
Страница 144: ...Copyright 2010 Juniper Networks Inc 118 JunosE 11 2 x IP Services Configuration Guide...
Страница 230: ...Copyright 2010 Juniper Networks Inc 204 JunosE 11 2 x IP Services Configuration Guide...
Страница 262: ...Copyright 2010 Juniper Networks Inc 236 JunosE 11 2 x IP Services Configuration Guide...
Страница 294: ...Copyright 2010 Juniper Networks Inc 268 JunosE 11 2 x IP Services Configuration Guide...
Страница 328: ...Copyright 2010 Juniper Networks Inc 302 JunosE 11 2 x IP Services Configuration Guide...
Страница 345: ...PART 2 Index Index on page 321 319 Copyright 2010 Juniper Networks Inc...
Страница 346: ...Copyright 2010 Juniper Networks Inc 320 JunosE 11 2 x IP Services Configuration Guide...
Страница 356: ...Copyright 2010 Juniper Networks Inc 330 JunosE 11 2 x IP Services Configuration Guide...