RE: BGP regular expression

From: Todd, Douglas M. (DTODD@PARTNERS.ORG)
Date: Mon May 05 2008 - 15:50:38 ART


Just some thoughts and ideas for testing:

 ^([0-9]+)(_\1)*$

\1 = backreference to what you previously matched. Is this what you wanted in
the regex... and not escaping actual bracket?

_ is the wild card here. Thus you could/might get away with ([0-9]+_)\1?

the * might cause some issues since it's 0 or more instances, but also
"wildcard" for anything, thus greediness kicks in.
The ? is 0 or more instances.

() can be optional if no grouping is needed or backreferencing is needed.

Remove the anchors ^ $ if we need to get the as anywhere else in the string
beside beginning and end. Add the anchors if you want to be very
specific and remove the possible "greediness" of the regex.

Just some ideas.. :)

DMT

-----Original Message-----
From: nobody@groupstudy.com [mailto:nobody@groupstudy.com] On Behalf Of Narbik
Kocharians
Sent: Monday, May 05, 2008 12:41 AM
To: Amir.Tahir/Wateen/Lahore
Cc: V.Shekhar@globalassurance.net; Rakesh Hegde; ccielab@groupstudy.com
Subject: Re: BGP regular expression

It looks good but i think you menat to do ^([0-9]+)(_1\)*$. This will match
prepending of the same AS.

On 5/4/08, Amir.Tahir/Wateen/Lahore <Amir.Tahir@wateen.com> wrote:
>
> I believe if you try the following expression, it will help
>
> If the AS is prepended, the following expression could be used to
> match the successive occurrences ^([0-9]+)(-\1)*$
>
> Do let us know yor findings and feedback
>
> Regards / AT
>
> -----Original Message-----
> From: nobody@groupstudy.com [mailto:nobody@groupstudy.com] On Behalf
> Of V.Shekhar@GlobalAssurance.net
> Sent: Thursday, May 01, 2008 10:29 PM
> To: Rakesh Hegde
> Cc: ccielab@groupstudy.com
> Subject: Re: BGP regular expression
>
> Sorry i meant to ask does it List 1.0 & 2.0 with ^(100_)+$ ?
> -V Shekhar
> CCIE(sec)#17589/CISSP/RHCE.
>
> V.Shekhar@GlobalAssurance.net wrote:
> > Does it list 1& 4 if u use ^(100_)+$ ?
> >
> > -V Shekhar
> > CCIE(sec)#17589/CISSP/RHCE.
> >
> > Rakesh Hegde wrote:
> >> Guys,
> >>
> >> I've got the following routes in the bgp table
> >>
> >> 192.168.1.0 100
> >> 192.168.2.0 100 100 100
> >> 192.168.3.0 100 200 300
> >>
> >>
> >> 1. Sh ip bgp reg (_100_)+ as expected lists all 3 networks
> >>
> >> 2. Sh ip bgp reg ^(_100_)+ as expected lists all 3 networks
> >>
> >> 3. Sh ip bgp reg (_100_)+$ as expected lists 192.168.1.0 and
> >> 192.168.2.0
> >>
> >> 4. Sh ip bgp reg ^(_100_)+$ lists only 192.168.1.0 .
> >>
> >> Any idea why no 4 is not listing 192.168.2.0 ?
> >>
> >> Thanks in advance
> >>
> >> -Rakesh
> >>
> >>
> >> Pass the CCIE in six weeks, Guaranteed!
> >> http://www.certscience.com/CCIE
> >>
> ______________________________________________________________________
> _
> >> Subscription information may be found at:
> >> http://www.groupstudy.com/list/CCIELab.html
> >
> >
> > Pass the CCIE in six weeks, Guaranteed!
> > http://www.certscience.com/CCIE
> >
> ______________________________________________________________________
> _
> > Subscription information may be found at:
> > http://www.groupstudy.com/list/CCIELab.html
>
>
> Pass the CCIE in six weeks, Guaranteed!
> http://www.certscience.com/CCIE
> ______________________________________________________________________
> _ Subscription information may be found at:
> http://www.groupstudy.com/list/CCIELab.html
>
>
> ______________________________________________________________________
> _ Subscription information may be found at:
> http://www.groupstudy.com/list/CCIELab.html
>
>
>
>
>

--
Narbik Kocharians
CCSI#30832, CCIE# 12410 (R&S, SP, Security) www.Net-Workbooks.com Sr. Technical
Instructor


This archive was generated by hypermail 2.1.4 : Mon Jun 02 2008 - 06:59:16 ART