RE: regular expression

From: Carole Warner Reece (cwr@xxxxxxxxxxxxxx)
Date: Sat Oct 06 2001 - 12:02:43 GMT-3


   
Dan -

I used your configs, and both forms of the community list worked for me.
Maybe it is your IOS version - I'm using 12.1(5)T8.

Carole
======
. . .
colorado#sh ip community-list
Community (expanded) access list 100
     permit ^.*:5$
Community (expanded) access list 101
     permit .*:10

colorado#sh ip bgp
BGP table version is 13, local router ID is 10.1.255.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 10.1.255.2 0 150 0 200 i
*> 10.1.2.0/24 10.1.255.2 0 300 0 200 i
*> 10.1.3.0/24 10.1.255.3 0 150 0 300 i
*> 10.1.4.0/24 10.1.255.3 0 300 0 300 i
*> 10.1.5.0/24 10.1.255.4 0 150 0 400 i
*> 10.1.6.0/24 10.1.255.4 0 300 0 400 i
*> 10.1.7.0/24 10.1.255.5 0 150 0 500 i
*> 10.1.8.0/24 10.1.255.5 0 300 0 500 i
*> 10.1.9.0/24 10.1.255.6 0 150 0 600 i
*> 10.1.10.0/24 10.1.255.6 0 300 0 600 i
*> 10.1.11.0/24 0.0.0.0 0 32768 i
*> 10.1.12.0/24 0.0.0.0 0 32768 i

colorado#sh ip bgp community-list 101
BGP table version is 13, local router ID is 10.1.255.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.2.0/24 10.1.255.2 0 300 0 200 i
*> 10.1.4.0/24 10.1.255.3 0 300 0 300 i
*> 10.1.6.0/24 10.1.255.4 0 300 0 400 i
*> 10.1.8.0/24 10.1.255.5 0 300 0 500 i
*> 10.1.10.0/24 10.1.255.6 0 300 0 600 i

colorado#sh ip bgp community-list 100
BGP table version is 13, local router ID is 10.1.255.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 10.1.255.2 0 150 0 200 i
*> 10.1.3.0/24 10.1.255.3 0 150 0 300 i
*> 10.1.5.0/24 10.1.255.4 0 150 0 400 i
*> 10.1.7.0/24 10.1.255.5 0 150 0 500 i
*> 10.1.9.0/24 10.1.255.6 0 150 0 600 i

colorado#

------------------------------------------------------------------------
Carole Warner Reece, CCIE #5168
Mentor Technologies
http://www.mentortech.com
------------------------------------------------------------------------
At 12:25 PM 9/30/01 +1000, Daniel Hong wrote:
>Hi Carole
>
>I was trying to filter community attribute
>
>200:5 200:10
>300:5 300:10
>400:5 400:10
>500:5 500:10
>600:5 600:10
>
>I used following community list, according Jeff Doyle's Routing TCP/IP
>volume II page 279
>ip community-list 100 permit .*:5
>ip community-list 101 permit .*:10
>
>But these lists don't work. I used following list, they works fine.
>
>ip community-list 100 permit ^.*:5$
>ip community-list 101 permit ^.*:10$
>
>I'm confused. I can't see any difference between these two lists in this
>scenario. Can you see any differences here?
>
>Regards
>
>Daniel
>-----Original Message-----
>From: Carole Warner Reece [mailto:cwr@mentortech.com]
>Sent: 30/09/2001 12:31
>To: Daniel Hong; ccielab@groupstudy.com
>Subject: Re: regular expression
>
>Daniel -
>
>For a quick summary, check out
>
>http://www.cisco.com/univercd/cc/td/doc/product/software/ios121/121cgcr/dial_r
/drdapp/drdrapre.htm
>
>In Expression 1
>'.*' means 0 or more instances of any character,
>':' has no special meaning, so is just the character ':'
>'5' has no special meaning, so is just the character '5'
>
>In Expression 2
>'^' matches the beginning of an input string
>'.*' means 0 or more instances of any character,
>':' has no special meaning, so is just the character ':'
>'5' has no special meaning, so is just the character '5'
>'$' matches the ending of an input string
>
>They both look for perhaps some characters ending with ':5', except the
>second expression looks for ONLY this pattern in the complete string.
>
>For example, with the string
> :5
>both expressions would match.
>
>With the string
> just:junk5
>neither expression would match.
>
>With the string
> just:junk:5
>both expressions would match.
>
>With the string
> just:junk:5here
>the Expression 1 would find a match, Expression 2 would not.
>
>Final example, with the string
> just:junk:5here:5
>both expressions would match.
>
>Carole
>
>PS - The book 'Mastering Regular Expressions' by Jeffrey Friedll (ISBN
>1-56592-257-3)
>is a very good reference for regular expressions.
>======
>At 08:29 PM 9/29/01 +1000, Daniel Hong wrote:
> >Hi Group
> >
> >Can anyone explain what is the difference between this two regular
> expression
> >
> > .*:5 and ^.*:5$
> >
> >thanks in advance
> >
> >Daniel
Having trouble posting? Read:
http://www.groupstudy.com/list/posting.html



This archive was generated by hypermail 2.1.4 : Thu Jun 20 2002 - 22:33:14 GMT-3