From: Adel Abouchaev (adel@netmasterclass.net)
Date: Sun Jul 11 2004 - 23:19:53 GMT-3
I think it is ^(.+_)*4(_.+)?$
because ^4_[0-9]*$ will not match 3 2 1 4, or 3 2 1 4 5. This will only
work if AS 4 is directly attached and that's stated in the question. In
case it is not in the
question, then "probably later on under the blue moon" there will be
another AS in between and it still gotta work. And also, it will always
seek to match a space
character, which is not the case if prefix is originated in AS4.
BGP will also trim the rightmost spaces in regexp if there is EOLN
character in the string to match. But I will not be so sure about it,
because "officially" it shall fail the match. Maybe this nice feature
will be cut off in the next build.
.+ might be changed to [0-9]+
I think + is more appropriate here than *, since AS number must have at
least one digit in it.
Cheers,
Adel Abouchaev
CCIE# 12037
www.netmasterclass.net
Joe Deleonardo wrote:
>D'OH! Light just went on.
>
>The * refers to what's inside the [ ]
>
>I was thinking it meant something more like ([0-9]*)*
>
>Cool! Thanks! That helped a lot!
>
>Cheers,
>
>Joe
>
>
>-----Original Message-----
>From: nobody@groupstudy.com [mailto:nobody@groupstudy.com] On Behalf Of
>James
>Sent: Sunday, July 11, 2004 5:45 PM
>To: Joe Deleonardo
>Cc: 'group study'
>Subject: Re: BGP Regular Expression - logic help
>
>
>
>>It seems like ^4_[0-9]?$ would be what we should use to get "Only Networks
>>Originated from AS 4, and ASs Directly Attached to AS 4" No?
>>
>>
>
>I believe ^4_[0-9]*$ should do your needs..
>
>
>
>>So what do you guys think? Am I over thinking this? Yes ^4_[0-9]*$ will
>>
>>
>get
>
>
>>you what you want but it seems like, you'll also get more then AS 4 and
>>
>>
>it's
>
>
>>directly attached networks.
>>
>>
>
>Hmm..? This seems to do it just fine. _[0-9]* means either match one more
>asn
>after 4, or match nothing after 4. I know it's a bit confusing :)
>
>output of.. sh ip bgp reg _701_[0-9]*$
>*> 6.1.0.0/16 63.239.36.245 1923 100 0 209 701 668 i
>*> 6.2.0.0/22 63.239.36.245 1923 100 0 209 701 668 i
>*> 6.3.0.0/18 63.239.36.245 1923 100 0 209 701 668 i
>*> 6.4.0.0/16 63.239.36.245 1923 100 0 209 701 668 i
>*> 6.5.0.0/19 63.239.36.245 1923 100 0 209 701 668 i
>*> 6.8.0.0/20 63.239.36.245 1923 100 0 209 701 668 i
>*> 6.9.0.0/20 63.239.36.245 1923 100 0 209 701 668 i
>*> 6.10.0.0/15 63.239.36.245 1923 100 0 209 701 668 i
>*> 6.14.0.0/15 63.239.36.245 1923 100 0 209 701 668 i
>*> 12.0.17.0/24 63.239.36.245 1923 100 0 209 701 26990 i
>*> 12.1.235.0/24 63.239.36.245 1923 100 0 209 701 15184 i
>*> 12.3.54.0/24 63.239.36.245 1923 100 0 209 701 25938 i
>*> 12.3.80.0/22 63.239.36.245 1923 100 0 209 701 10998 i
>*> 12.3.217.0/24 63.239.36.245 1923 100 0 209 701 16666 i
>etc etc etc...
>
>
>
>
>>You know if I had the choice of Cisco improving on any one thing - this
>>would be it. There's got to be an easier way to catch this mouse.
>>
>>
>
>JUNOS as-path matching is a heck of a lot easier..
>
>-J
>
>
>
>>Thanks in advance!
>>
>>Joe
>>
>>[GroupStudy removed an attachment of type application/ms-tnef which had a
>>
>>
>name of winmail.dat]
>
>
>>_______________________________________________________________________
>>Please help support GroupStudy by purchasing your study materials from:
>>http://shop.groupstudy.com
>>
>>Subscription information may be found at:
>>http://www.groupstudy.com/list/CCIELab.html
This archive was generated by hypermail 2.1.4 : Sun Aug 01 2004 - 10:11:52 GMT-3