They are similar, but not the same.
The first says...
Match from the start of the line
Match 54
Match a space
I don't care about the rest
The second says...
Match from the start of the line
Match 54
Match a space
Match a number 0 to 9, one or more times (as few characters as needed,
ungreedy)
I don't care about the rest
The big difference is that the second regex will require that the next AS
must be a normal AS number, 0 to 9. If it is an AS_SET next (parenthesis),
or a confederacy (squiggly brackets) next, the second regex will not match
but the first will.
Also, note that neither regex will match for AS54-originated routes, as you
a requiring a space after 54.
When I'm trying to create regexes, http://gskinner.com/RegExr/ is my best
friend.
Keller Giacomarro
keller.g_at_gmail.com
On Fri, Jan 6, 2012 at 5:42 AM, Vincent Tay <vtay.75_at_gmail.com> wrote:
> Hi all,
>
> Any differences between the below BGP regexp?
>
> ^54_ and ^54(_[0-9]+)?$ to match originated from AS54 and its directly
> connected customers?
>
>
> Blogs and organic groups at http://www.ccie.net
>
> _______________________________________________________________________
> Subscription information may be found at:
> http://www.groupstudy.com/list/CCIELab.html
Blogs and organic groups at http://www.ccie.net
Received on Fri Jan 06 2012 - 07:04:25 ART
This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 11:52:51 ART