Got it

Looking for an as-path regular expression

Created: Sep 26, 2019 07:38:54Latest reply: Sep 26, 2019 11:46:17 627 8 0 0 0
  Rewarded HiCoins: 0 (problem resolved)

We are using the regular expression to match the BGP routes which generates from the ISP or directly connected to the ISP, also the BGP prepend should be considered.

For example, the ISP AS number is 100, then the regular expression should match those routes with AS-PATH such as 100 100 100 123, but not 100 100 100 123 234.


Featured Answers

Recommended answer

chenhui
Admin Created Sep 26, 2019 09:44:40

Posted by sim_157 at 2019-09-26 09:41 thanks, but it didn't work.
Sorry, I made a mistake. Please try this one ^100_(100)_*[0-9]*$
View more
  • x
  • convention:

All Answers
hello,
please try this RegExp: ^100_[100_]*[0-9]*$
View more
  • x
  • convention:

Hi there,
Or try this one:

^(100\s){2}100\s123$

cheers,
Seb.
View more
  • x
  • convention:

Posted by chenhui at 2019-09-26 07:39 hello,please try this RegExp: ^100_[100_]*[0-9]*$
thanks, but it didn't work.
View more
  • x
  • convention:

Posted by sebr at 2019-09-26 09:08Hi there,Or try this one:^(100\s){2}100\s123$cheers,Seb.

thanks, I tried, it didn't work either. Else, the last AS number might not be the 123, it could be any other.
View more
  • x
  • convention:

Posted by sim_157 at 2019-09-26 09:41 thanks, but it didn't work.
Sorry, I made a mistake. Please try this one ^100_(100)_*[0-9]*$
View more
  • x
  • convention:

hmmm, odd regex syntax...try this:

^100_(100)_*(123)$
View more
  • x
  • convention:

Posted by sebr at 2019-09-26 09:55 hmmm, odd regex syntax...try this:^100_(100)_*(123)$
thanks, I tried this, it could work when the last AS number is 123, but failed when the last AS is other number.

^100_(100)_*[0-9]*$ this one could work fine.

Anyway, thank you very much. :)
View more
  • x
  • convention:

Posted by chenhui at 2019-09-26 09:44 Sorry, I made a mistake. Please try this one ^100_(100)_*[0-9]*$
Thanks, it worked.
View more
  • x
  • convention:

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.