RE: Regular Expression Fun

From: McEvoy, Joseph (Joseph.McEvoy@xxxxxxxxxxxxx)
Date: Sun Jun 23 2002 - 16:14:48 GMT-3


   
There is a great way to learn regex on real Internet backbone routers. Check
out:

 http://www.netconfigs.com/general/cisco-telnets.htm

These cisco routers are peering with other BGP routers that have full
Internet routing tables, and they do not forward any packets. A great way to
learn regular expressions, and to see how routes look on different parts of
the Internet.

Have fun!

-----Original Message-----
From: Nick Nikolov [mailto:nnikolov@go2call.com]
Sent: Sunday, June 23, 2002 8:36 AM
To: Omer Ansari; Brian McGahan
Cc: ccielab@groupstudy.com
Subject: Re: Regular Expression Fun

Omer,

Your solution would work fine, except with the following bgp path:

10 100

It wont picked it because you have two _ pattern.
The other way to make it is:

^10_(.*_)?100$

or making it more complex, if you want to filter path learned from 10,
containing 200 and originated in 100

^10_(.*_)?200_(.*_)?100$

Nick

----- Original Message -----
From: "Omer Ansari" <root@ansari.com>
To: "Brian McGahan" <brian@cyscoexpert.com>
Cc: <ccielab@groupstudy.com>
Sent: Saturday, June 22, 2002 8:05 PM
Subject: Re: Regular Expression Fun

> 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