RE: BGP regular expression

From: Todd, Douglas M. (DTODD@PARTNERS.ORG)
Date: Mon May 05 2008 - 17:29:41 ART


especially when you are using a HP finacial calculator.. .Makes life very
good.....

DMT

   _____

From: Narbik Kocharians [mailto:narbikk@gmail.com]
Sent: Monday, May 05, 2008 4:05 PM
To: Todd, Douglas M.
Cc: Amir.Tahir/Wateen/Lahore; V.Shekhar@globalassurance.net; Rakesh Hegde;
ccielab@groupstudy.com
Subject: Re: BGP regular expression

excellent explanation, it's like the calculators, when you have, let's say
96785
multiple by 64578 and then subtract 578, you normally do the multiplication
and
put the result in the memory and then recall that number from memory and
subtract 578. You are basically doing the same thing here.

On 5/5/08, Todd, Douglas M. <HYPERLINK
"mailto:DTODD@partners.org"DTODD@partners.org> wrote:

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: HYPERLINK "mailto:nobody@groupstudy.com"nobody@groupstudy.com
[mailto:HYPERLINK "mailto:nobody@groupstudy.com"nobody@groupstudy.com] On
Behalf
Of Narbik
Kocharians
Sent: Monday, May 05, 2008 12:41 AM
To: Amir.Tahir/Wateen/Lahore
Cc: HYPERLINK
"mailto:V.Shekhar@globalassurance.net"V.Shekhar@globalassurance.net; Rakesh
Hegde; HYPERLINK "mailto:ccielab@groupstudy.com"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 <HYPERLINK
"mailto:Amir.Tahir@wateen.com"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: HYPERLINK "mailto:nobody@groupstudy.com"nobody@groupstudy.com
[mailto:HYPERLINK "mailto:nobody@groupstudy.com"nobody@groupstudy.com] On
Behalf
> Of V.Shekhar@GlobalAssurance.net
> Sent: Thursday, May 01, 2008 10:29 PM
> To: Rakesh Hegde
> Cc: HYPERLINK "mailto:ccielab@groupstudy.com"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
> >>
> >> HYPERLINK "http://192.168.1.0"192.168.1.0 100
> >> HYPERLINK "http://192.168.2.0"192.168.2.0 100 100 100
> >> HYPERLINK "http://192.168.3.0"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 HYPERLINK
"http://192.168.1.0"192.168.1.0 and
> >> HYPERLINK "http://192.168.2.0"192.168.2.0
> >>
> >> 4. Sh ip bgp reg ^(_100_)+$ lists only HYPERLINK
"http://192.168.1.0"192.168.1.0 .
> >>
> >> Any idea why no 4 is not listing HYPERLINK
"http://192.168.2.0"192.168.2.0
?
> >>
> >> Thanks in advance
> >>
> >> -Rakesh
> >>
> >>
> >> Pass the CCIE in six weeks, Guaranteed!
> >> HYPERLINK
"http://www.certscience.com/CCIE"http://www.certscience.com/CCIE
> >>
> ______________________________________________________________________
> _
> >> Subscription information may be found at:
> >> HYPERLINK
"http://www.groupstudy.com/list/CCIELab.html"http://www.groupstudy.com/list/C
CIE
Lab.html
> >
> >
> > Pass the CCIE in six weeks, Guaranteed!
> > HYPERLINK
"http://www.certscience.com/CCIE"http://www.certscience.com/CCIE
> >
> ______________________________________________________________________
> _
> > Subscription information may be found at:
> > HYPERLINK
"http://www.groupstudy.com/list/CCIELab.html"http://www.groupstudy.com/list/C
CIE
Lab.html
>
>
> Pass the CCIE in six weeks, Guaranteed!
> HYPERLINK "http://www.certscience.com/CCIE"http://www.certscience.com/CCIE
> ______________________________________________________________________
> _ Subscription information may be found at:
> HYPERLINK
"http://www.groupstudy.com/list/CCIELab.html"http://www.groupstudy.com/list/C
CIE
Lab.html
>
>
> ______________________________________________________________________
> _ Subscription information may be found at:
> HYPERLINK
"http://www.groupstudy.com/list/CCIELab.html"http://www.groupstudy.com/list/C
CIE
Lab.html
>
>
>
>
>

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


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