I want to write a regex in Juniper MX960 router for BGP including 3 AS paths with first element is constant, second and third are wildcard. I found that we can put as numbers manually like this:
"9121+ (one|two|three|…) (one|two|three|…)". This doesn't work for me cause i don't know whole as numbers in second and third level. They can be anything. I want them to be "any".
"9121+ any+ any+" « I need this.
Thank you.
Best Answer
Assuming you want to match on any AS path that consists of exactly 3 AS numbers, with the first being 9121, you would want this:
9121 .+ .+