bgp as path reqexp

Answered Question
Aug 5th, 2007

hi everyone, i was reading ccie exam cert bt wendell odom and got confused in one of its examples. its from page 435 table 13-5.

reg exp is ^123_.*_45$

"An AS_PATH beginning with AS 123 and ending in AS 4, with atleast one other AS in between."

i think its bit wrong coz . is followed by * which means zero or more occurence of the preceding character now if there is no character between 123 and 45 then its also valid isnt it ? so why its saying that atleast one AS between them ?

am i wrong in my understanding ? kindly tell me.

I have this problem too.
0 votes
Correct Answer by mohammedmahmoud about 9 years 5 months ago

Hi,

Theoretically speaking you are right, ".*" means zero or more, but the fact that you have "_" before and after it, and thus this regular expression can't match 123 45, as this one has only one space between the 2 ASs, then practically this regexp will only match when there is at lease one AS in between.

HTH,

Mohammed Mahmoud.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (2 ratings)
Loading.
Correct Answer
mohammedmahmoud Sun, 08/05/2007 - 01:35

Hi,

Theoretically speaking you are right, ".*" means zero or more, but the fact that you have "_" before and after it, and thus this regular expression can't match 123 45, as this one has only one space between the 2 ASs, then practically this regexp will only match when there is at lease one AS in between.

HTH,

Mohammed Mahmoud.

mohammedmahmoud Sun, 08/05/2007 - 02:11

hi Ovais,

You are very welcomed :) and thanks for using the rating system.

HTH,

Mohammed Mahmoud.

Actions

This Discussion