Re: Re: A matter of a regular Expression

From: Cyrus <cyrus.mgh_at_gmail.com>
Date: Mon, 13 Apr 2009 18:53:13 +1000

Well Aly,

I'm a bit angry about myself since my memory is rusty about regular
expressions in Cisco rather Linux world ,specifically "_" character. so I
doubted about my first message.

After closer look and looking into Cisco regular expression Reference.

http://www.cisco.com/en/US/docs/ios/12_2/termserv/configuration/guide/tcfaapre_ps1835_TSD_Products_Configuration_Guide_Chapter.html

I was correct at my first message. your expression is as same as workbook's
Solution.That one wants to separate "space by putting whole expression
"_[0-9]+" in () but u match on " _" that matches end of string or space.

*1) Do not match AS100 Only routes.
*
"_" Replaces a long regular expression list by matching a comma (,), left
brace ({), right brace (}), the beginning of the input string, the end of
the input string, or a space.

so ^100_[1-9]*$ would match ^100$ as well

*2) Without a "0" in [1-9], it won't match AS numbers like 300, 500, 405
etc.*
obviously it was typo --> [0-9]

*3)The * would match everything. AS100's customer's customers and their
customers etc.*

"*" Matches zero or more sequences of the character preceding the asterisk.

so it wouldn't match 100 300 400. [0-9]* would not match "space".

So they are pretty same.yours is a simpler version.

HTH,

Cyrus

On Mon, Apr 13, 2009 at 6:19 PM, <aly.groupstudy_at_gmail.com> wrote:

> Sorry for the typo mistake ^100_[1-9]*$ should of course be ^100_[0-9]*$
>
> Actually Cyrus you are correct
>
> 1) Do not match AS100 Only routes.
> ^100_[0-9]*$ will match routes originated from 100
> note the * matches "ZERO" or more occurance
>
>
> 2) Without a "0" in [1-9], it won't match AS numbers like 300, 500, 405
> etc.
> sorry my mistake should be ^100_[0-9]*$ but we all get the idea ( clumsy
> me)
>
>
> 3) The * would match everything. AS100's customer's customers and their
> customers etc.
> No I do not think it would as the range [0-9] does not include the space
> char
> or the _ operator
>
> I still thinks they would work the same with mine only shorter and maybe
> simpler
>
>
> Blogs and organic groups at http://www.ccie.net
>
> _______________________________________________________________________
> Subscription information may be found at:
> http://www.groupstudy.com/list/CCIELab.html
>
>
>
>
>
>
>
>

-- 
Sirus Moghadasian
CCIE #21862 (R&S)
Blogs and organic groups at http://www.ccie.net
Received on Mon Apr 13 2009 - 18:53:13 ART

This archive was generated by hypermail 2.2.0 : Mon May 04 2009 - 07:39:11 ART