Re: Regular Expression Fun

From: Omer Ansari (root@xxxxxxxxxx)
Date: Sat Jun 22 2002 - 22:05:20 GMT-3


   
Brian,
have not tested it, but thinking *nix/perl regexps, I would think

^10_.*_100$

could work also.

".*" can match nothing also. (atleast that's true for *nix!)

the only problem I can see with the above is the second "_" though..

On Fri, 21 Jun 2002, Brian McGahan wrote:

> Groupmembers,
>
> I have an interesting teaser, and hopefully it will spawn a
> useful thread. I was making one of my students play with regular
> expressions today, and I asked him to create a regexp that matches
> routes learned from AS 10, which have originated in AS 100. I came up
> with: ^10_(|.*_)100$
>
> My logic being
>
> ^10_ learned from 10, space
> (|.*_) nothing, or something that ends in a space
> 100$ originated from AS 100
>
> My logic may be off. This is why I gave up programming ;)
>
> 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



This archive was generated by hypermail 2.1.4 : Tue Jul 02 2002 - 08:12:40 GMT-3