Regular Expression

From: Chan Hong (chan_hong33@yahoo.com)
Date: Tue Dec 11 2007 - 10:53:23 ART


Dear all,

I want to ask about regulat expression, * and [], ()
From my
understanding, show ip bgp regxp 1234(_[0-9]*)$ will show all bgp route with
as path starting from 1234 and zero or one other as in the as path (eg., 1234
4321, or 1234)
But if without $, the result is all bgp routes with as path
starting from 1234 and 0 or MORE other as in the as path (eg., 1234, 1234
4321, 1234 4321 4567 122)
why??

$ means the end of the pattern, but which
symbol mean the repeat pattern???
The * is inside (), next to [0-9]. The
repeat pattern should apply on character 0-9 only. Inside the (), there is a _
also, which can be "space" or end of string. Why without the $, the show ip
bgp rexp 1234(_[0-9]*) can be something like:

R1#sh ip bgp regexp
1234(_[0-9]*)
BGP table version is 3, local router ID is 10.155.129.1
Status
codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 3.0.0.0
10.155.129.2 200 0 1234 103 80 i
*> 8.5.250.0/24
10.155.129.4 200 0 1234 10 13 15 i
*> 15.149.2.0/24
10.155.129.4 200 0 1234 10 i

Regards,
Howard
Yahoo! g62d8
e. e(f;g%o< fd= e&d=i2g/i;e."! h+ e e>
http://hk.promo.yahoo.com/security/index.htmld:h'#f4e$!



This archive was generated by hypermail 2.1.4 : Tue Jan 01 2008 - 12:04:30 ARST