I saw this explanation in the JNCIS study guide book ch1 (community regex examples) and i'm a bit confused:
^65000:.{2,3}$ – AS number is 65000, community value is any 2 or 3 digit number ex. 65000:123, 65000:16, and 65000:999
^65010:45.{2}9$ – AS number is 65010. The community value is a five-digit number that begins with 45 and ends with 9. The third and fourth digits are any single number repeated twice ex. 65010:45119, 65010:45999, and 65010:45339.
If .{2} means any single number repeated twice, then i'd have argued .{2,3} if any single number repeated at least twice and at most thrice and not any 2 or 3 digit number as explained in the book.
What is the right interpretation of these 2 regex ?
Thanks,
Best Answer
I set up a quick'n'dirty lab and it would appear that the first example is actually correct, rather than the second.
The first example, I've got three routes being received, each tagged with a community of
65000:123
,65000:999
or65000:16
:The second example I've got a route tagged with
65010:45129
(not65010:45119
as per the book) and I still get a match:So yes,
.{2}
means any two characters and.{2,3}
means any two-to-three characters.