^ matches the beginning of a line (everything in
life has a start)
[0-9] includes any number between 0 and 9
+ after [0-9] means any number between 0 and 9 must be repeated 1 or
more times.
( ) groups multiple expressions together.
_ Underscore will match any Delimiter (including
beginning, end, space, tab, comma)
In this example it will most likely match a SPACE.
\1 references the previous Parenthesis ([0-9]+)
(_\1) means that any number 0-9 may repeat x amount of times
preceded by a SPACE, or beginning-of line
(_\1)* the * means the previous statement can be repeated zero
or more times.
$ in this case: run the loop from the previous statement
until the number sequence is followed by a end-of-line.
The short version :
If used in a as-path access-list, it will match ANY neighboring ASN
while allowing that AS to prepend their ASN x amount of times.
HTH
-- <ruhann> www.routing-bits.com On Mon, May 24, 2010 at 8:27 AM, Raghav Bhargava <raghavbhargava12_at_gmail.com> wrote: > Hi Experts, > > Can anyone please explain this Regular Expression: > > ^([0-9]+)(_\1)*$ > > > -- > Warm Regards > Raghav > > > Blogs and organic groups at http://www.ccie.net > > _______________________________________________________________________ > Subscription information may be found at: > http://www.groupstudy.com/list/CCIELab.html > > > > > > > > -- <ruhann> www.routing-bits.com Blogs and organic groups at http://www.ccie.netReceived on Mon May 24 2010 - 09:23:35 ART
This archive was generated by hypermail 2.2.0 : Tue Jun 01 2010 - 07:09:53 ART