Optional Characters: Matching a Character That May or May Not Be There

 

The question mark (?) matches zero or one instances of a literal. For example:

  ip as-path access-list 27 permit ^(850)?$  

This filter matches an AS_PATH in which there is either a single AS number 850 or an empty list. Note the use of parentheses here, to show that the metacharacter applies to the entire AS number. If the expression 850? is used, the metacharacter applies only to the last character. The expression would match 85 or 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