BGP Regular Expression
BGP Regular Expression
1. Atom An atom is a single character, such as the following
|
. |
- Matches any single character |
|
^(Carat) |
- Matches the beginning of the input string
ex) ^5 it will match with the below 5 100 712 548 453 343 ex) show ip bgp regexp 5 it will match with the below 100 598 4130 200 453 3400 |
|
$ |
- Matches the end of the input string
ex) 500$ it will match with the below
100 768 500
100 675 3500 343 233 4572 345 500 |
|
\ |
- Matches the character |
|
_ |
- Matches a comma (,), left brace ({), right brace (}), the beginning of the input string, the end of the input string, or a space.
ex) _10_ |
|
[ ] |
- Define a range |
2. Piece A piece is an atom followed by one of the following symbols
|
* |
Matches 0 or more sequences of the atom |
|
+ |
Matches 1 or more sequences of the atom |
|
? |
Matches the atom or the null string |
3. Branch A branch is a 0 or more concatenated pieces
|
a* |
Any occurrence of the letter "a", including none |
|
a+ |
At least one occurrence of the letter "a" should be present) |
|
ab?a |
This matches "aa" or "aba |
|
_100_ |
Via AS100 |
|
^100$ |
Origin AS100
ex) sh ip bgp regexp ^100$ 100
|
|
^100 .* |
Coming from AS100 |
| ^.100 |
ex) sh ip bgp regexp ^.100 |
| _[1-9]567$ | ex) 344 1567 50 232 3567 100 4546 8567 |
| ^5[1-4]7_ | ex) 517 456 537 400 234 527 300 232 |
| ^100_ |
ex) sh ip bgp regexp ^100_ |
|
^$ |
Originated from this AS |
Last Updated (Sunday, 14 June 2009 23:56)


