could anyone tell me what ip as-path access-list 100 deny .+_.+_.+_.+_.+_.+_.+_.+_.+_.+_.+_.+
stands for?!
I searched over the internet for the meaning of this regular expression, but I was unable to find any info.
Every time you see .+_
, that regular expression represents a single BGP autonomous system. This as-path list denies BGP as paths equal to or longer than 12 paths long.
The regular expression works because .
represents any character, +
is a wild card which optionally repeats the previous character an unlimited number of times, and _
represents the space between the autonomous system paths. For more information, refer to the Cisco IOS Regular Expression guide, or this INE BGP Regular Expressions blog.
It'll be matching 12 AS-path list. But, I think a more appropriate way of matching it would be ^[0-9]+_[0-9]+_[0-9]+_[0-9]+_[0-9]+_[0-9]+_[0-9]+_[0-9]+_[0-9]+_[0-9]+_[0-9]+_[0-9]+$, because the expression you mentioned might just match any character ie. special characters and alphabets included.
[0-9]+[0-9]+
doesn't account for the space between autonomous system paths. In plain terms, it says to match 0-9 ([0-9]
) an infinite amount of times (+
) followed directly by another set of infinite 0-9 sets ([0-9]+
).
Commented
May 9, 2015 at 15:07