Using Metacharacters As Literal Tokens; Regular Expression Examples - Juniper JUNOSE SOFTWARE FOR E SERIES 11.3.X - IP SERVICES CONFIGURATION GUIDE 2010-10-01 Configuration Manual

Software for e series broadband services routers ip services configuration guide
Table of Contents

Advertisement

JunosE 11.3.x IP Services Configuration Guide

Using Metacharacters as Literal Tokens

Example

Regular Expression Examples

44
Table 5: Supported Regular Expression Metacharacters (continued)
Metacharacter
Description
()
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.
– (hyphen)
Used within brackets to specify a range of AS or community numbers.
_ (underscore)
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.
|
Matches characters on either side of the metacharacter; logical OR.
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.
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\)
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.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Junose 11.3

Table of Contents