From: ying c (bf5tgh1@xxxxxxxxx)
Date: Thu Aug 22 2002 - 19:54:21 GMT-3
Taking your 4 conditions, how about
^1000 ([0-9]*)? 100 ([0-9]*)? 10$
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
> To: 'Brian McGahan'; 'elping'; 'Michael Snyder'
> Cc: steven.j.nelson@bt.com; ccielab@groupstudy.com
> Subject: regexp fun (was RE: Filtering BGP updates
> using ip as-path
> access-lists)
>
>
> Did we give up already?
>
> <snip>
>
> Try this one: All routes originated in AS 10,
> passed through AS
> 100, and learned from AS 1000. (In one line)
>
> HTH
>
> Brian McGahan, CCIE #8593
> Director of Design and Implementation
> brian@cyscoexpert.com
>
> CyscoExpert Corporation
> Internetwork Consulting & Training
> http://www.cyscoexpert.com
> Voice: 847.674.3392
> Fax: 847.674.2625
>
>
> -----Original Message-----
> From: nobody@groupstudy.com
> [mailto:nobody@groupstudy.com] On Behalf Of
> elping
> Sent: Sunday, August 18, 2002 9:46 AM
> To: Michael Snyder
> Cc: steven.j.nelson@bt.com; ccielab@groupstudy.com
> Subject: Re: Filtering BGP updates using ip as-path
> access-lists
>
> steve :
> consider that
> ^4 [0-9]* will be an exact 4 and some other number
> so any routes coming from 4 will not show up...
>
> i put your theory to the test on an actual Bgp
> routing table observ.
> I am using 7788 and all it's connected routes..
>
> in summary the underscore will allow 7788 routes and
> it's
> connected...without the underscore
> you are saying a exact 7788 and it's
> connected.....see for yourself...
>
> if i mistyped or got you thoughts wrong feel free to
> correct..
>
>
>
> using your string i obtain nothing
> route-server.east>sh ip bgp reg ^7788 [0-9]* [0-9]*$
> route-server.east>
>
>
=== message truncated ===
This archive was generated by hypermail 2.1.4 : Sat Sep 07 2002 - 19:48:34 GMT-3