Repetition: Matching a Number of Repeating Characters

 

Repetition: Matching a Number of Repeating Characters

You can use two metacharacters to match repeating literals: The asterisk (*) matches zero or more instances of a literal, and the plus (+) matches one or more instances. For example:

  ip as-path access-list 28 permit ^(850)*$  

This filter matches an AS_PATH in which there are no AS numbers, or in which one or more AS numbers 850 exist. That is, the AS path could be (850), (850, 850), (850, 850, 850), and so on.

The following filter is similar, except that there must be at least one AS number 850 in the AS_PATH:

  ip as-path access-list 29 permit ^(850)+$  


Routing TCP[s]IP (Vol. 22001)
Routing TCP[s]IP (Vol. 22001)
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 182

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net