RE: regexp fun

From: ying c (bf5tgh1@xxxxxxxxx)
Date: Thu Aug 22 2002 - 21:56:18 GMT-3


   
Thanks. But the router rejected the expression with

"% *+ operand could be empty"

error message. So I use the following:

^1000 ?([0-9].*)? 100 ?([0-9].*)? 10$

and it seems work fine with my small bgp test routes:

fr#sib
BGP table version is 25, local router ID is
192.168.1.1
Status codes: s suppressed, d damped, h history, *
valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network Next Hop Metric LocPrf
Weight Path
*> 10.1.1.0/24 192.168.1.9 0
  0 1000 100 10 i
*> 10.1.2.0/24 192.168.1.9 0
  0 1000 2 22 100 10 i
*> 10.1.3.0/24 192.168.1.9 0
  0 1000 100 33 3 10 i
*> 10.1.4.0/24 192.168.1.9 0
  0 1000 4 44 444 i
*> 10.1.5.0/24 192.168.1.9 0
  0 1000 10 100 i
*> 10.1.6.0/24 192.168.1.9 0
  0 1000 10 i
*> 10.1.7.0/24 192.168.1.9 0
  0 1000 100 345 i
*> 10.1.8.0/24 192.168.1.9 0
  0 1000 235 10 i
*> 10.1.9.0/24 192.168.1.9 0
  0 1000 9 19 100 29 10 i
fr#show ip bgp regexp ^1000 ?([0-9].*)? 100
?([0-9].*)? 10$
BGP table version is 25, local router ID is
192.168.1.1
Status codes: s suppressed, d damped, h history, *
valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network Next Hop Metric LocPrf
Weight Path
*> 10.1.1.0/24 192.168.1.9 0
  0 1000 100 10 i
*> 10.1.2.0/24 192.168.1.9 0
  0 1000 2 22 100 10 i
*> 10.1.3.0/24 192.168.1.9 0
  0 1000 100 33 3 10 i
*> 10.1.9.0/24 192.168.1.9 0
  0 1000 9 19 100 29 10 i
fr#

--- Michael Snyder <msnyder@ldd.net> wrote:
> >Taking your 4 conditions, how about
> >^1000 ([0-9]*)? 100 ([0-9]*)? 10$
>
> If ([0-9]*)? Nulls out, then you have two spaces
> between 1000 and 100,
> etc.
> If it doesn't null out, and you get rid of the
> spaces, then the as's can
> run together.
>
> Try
>
> ^1000( .*)* 100( .*)* 10$
>
> It has a space as part of the compound piece,
> therefore if it nulls out,
> we still have the required space in front of 100,
> etc.
>
> BTW, route-server.exodus.net takes about five
> minutes to process my
> expression, I thought it locked up the first time.
> Think I just figured
> out a DOS attack with a bgp path expression!
>
>
>
>
> -----Original Message-----
> From: nobody@groupstudy.com
> [mailto:nobody@groupstudy.com] On Behalf Of
> ying c
> Sent: Thursday, August 22, 2002 5:54 PM
> To: Edward Monk; 'Bauer, Rick';
> ccielab@groupstudy.com
> Subject: RE: regexp fun
>
>
> i.e.
>
> a. if 1st ? = 0, 2nd ? = 1 => ^1000 100 ([0-9]*)?
> 10$
> b. if 1st ? = 1, 2nd ? = 0 => ^1000 ([0-9]*)? 100
> 10$
> c. if 1st ? = 0, 2nd ? = 0 => ^1000 100 10$
> d. if 1st ? = 1, 2nd ? = 1 => ^1000 [0-9]* 100
> [0-9]*
> 10$
>
> Chang
> --- Edward Monk <emonk@att.net> wrote:
> > I used to think that as recent as yesterday. But
> it
> > doesn't meet the
> > criteria.
> >
> > It will match 10000 100 10 for sure.
> >
> >
> > Now think of this logic.
> >
> > Here was my first working solution that satisfied
> > the criteria.
> >
> > Brian never said be as efficient as possible.
> (Lame
> > excuse)
> >
> > It took four branches to perform the logic as I
> > understood it.
> >
> > Match 1000 100 10 if not then
> > Match 1000 100 ([0-9].*) 10 if not then
> > Match 1000 ([0-9].*) 100 10 if not then
> > Match 1000 ([0-9].*) 100 ([0-9].*) 10 if not then
> > End
> >
> > This worked out to be in long hand as the
> following
> > expression.
> >
> > ((^1000 100 10$)|(^1000 100 ([0-9].*) 10$)|(^1000
> > ([0-9].*) 100
> > 10$)|(^1000 ([0-9].*) 100 ([0-9].*) 10$))
> >
> > I have since solved this in a very compact
> solution.
> > One I believe is as
> > compact as it gets and still meets the criteria
> that
> > Brian laid out.
> >
> > -----Original Message-----
> > From: Bauer, Rick [mailto:BAUERR@toysrus.com]
> > Sent: Thursday, August 22, 2002 1:42 PM
> > To: 'Edward Monk'; 'ccielab@groupstudy.com'
> > Subject: RE: regexp fun (was RE: Filtering BGP
> > updates using ip as-path
> > ac cess-lists)
> >
> > What I mean is I am a dumb ass and have been
> smoking
> > crack all day and I
> > should stick to doing one thing at a time or at
> > least devoting more then
> > two
> > seconds to reply to something. Yes you are correct
> > it is backwards. But
> > it
> > should work this way.
> >
> > sho ip bgp reg ^1000 ?.* 100 ?.* 10$
> >
> >
> >
> > -----Original Message-----
> > From: Edward Monk [mailto:emonk@att.net]
> > Sent: Thursday, August 22, 2002 3:36 PM
> > To: 'Bauer, Rick'
> > Subject: RE: regexp fun (was RE: Filtering BGP
> > updates using ip as-path
> > ac cess-lists)
> >
> >
> > Yes, your point is what?
> >
> > -----Original Message-----
> > From: Bauer, Rick [mailto:BAUERR@toysrus.com]
> > Sent: Thursday, August 22, 2002 1:23 PM
> > To: 'Edward Monk'
> > Cc: ccielab@groupstudy.com
> > Subject: RE: regexp fun (was RE: Filtering BGP
> > updates using ip as-path
> > ac cess-lists)
> >
> > I'm giving a "sho ip bgp reg" not an as-path
> filter.
> >
> > -----Original Message-----
> > From: Edward Monk [mailto:emonk@att.net]
> > Sent: Thursday, August 22, 2002 3:18 PM
> > To: 'Bauer, Rick'
> > Cc: ccielab@groupstudy.com
> > Subject: RE: regexp fun (was RE: Filtering BGP
> > updates using ip as-path
> > ac cess-lists)
> >
> >
> > Still not correct. Besides being reverse logic
> what
> > I mean by that is
> > your regexp says match routes originated in AS
> 1000
> > not 10 as Brian's
> > criteria called for. But accounting for that it
> > still would not work.
> >
> > The beginning would match 1 10 100 1000 10000 at
> the
> > very least.
> >
> > -----Original Message-----
> > From: nobody@groupstudy.com
> > [mailto:nobody@groupstudy.com] On Behalf Of
> > Bauer, Rick
> > Sent: Thursday, August 22, 2002 12:21 PM
> > To: 'Brian McGahan'; 'elping'; 'Michael Snyder'
> > Cc: 'ccielab@groupstudy.com'
> > Subject: RE: regexp fun (was RE: Filtering BGP
> > updates using ip as-path
> > ac cess-lists)
> >
> > Not correct I need another "?"
> >
> > sh ip bgp reg ^10 ?.* 100 ?.* 1000$
> >
> > Rick, #9482
> >
> > -----Original Message-----
> > From: Bauer, Rick
> > Sent: Thursday, August 22, 2002 2:09 PM
> > To: 'Brian McGahan'; 'elping'; 'Michael Snyder'
> > Cc: ccielab@groupstudy.com
> > Subject: RE: regexp fun (was RE: Filtering BGP
> > updates using ip as-path
> > access-lists)
> >
> >
> > Okay Brain, you intrigued me. Here is the regular
> > expression for your
> > question. You helped me find a new use for the
> "?".
> > Cool stuff!
> >
> > sh ip bgp reg ^10 ?.* 100 .* 1000$
> >
> > Rick, #9482
> >
> > -----Original Message-----
> > From: Brian McGahan [mailto:brian@cyscoexpert.com]
> > Sent: Wednesday, August 21, 2002 10:21 AM
>
=== message truncated ===



This archive was generated by hypermail 2.1.4 : Sat Sep 07 2002 - 19:48:34 GMT-3