Hello Adam,
^123_.*_45$ = This looks to me as though it would match an AS starting with 123 and ending in 45 with
only 1 AS in between them.
Not entirely. The following regexp means: The AS_PATH must start with AS number 123, then it may contain an arbitrary count of arbitrary AS numbers, and must end with AS number 45. The ".*" expression stands for "any character arbitrarily many times, including a delimiter between AS numbers".
If you wanted to have an regexp that starts with AS 123, ends with AS 45 and allows for only a single AS inbetween, the regexp would be sligthly more complicated:
^123_[0-9]+_45$
^123_.*45 = What does this match? the book I'm reading says it matches an AS path beginning with 123, with zero or more intermediate AS's and delimiters and ending with an AS whote last two digits are 45.
This is correct.
So for me reading this all I can see is that it starts with 123_ and then has any character immediatly followed by 45.
Do not forget the role of the * quantifier here. What you described here would be true for the regexp ^123_.45$ without the asterisk. However, the regexp ^123_.*45$ allows the any character including delimiter to repeat arbitrarily many times (0 or more).
Does this make sense? Please feel welcome to ask further!
Best regards,
Peter