| 1 |
Value VRF (\S+) |
| 2 |
Value RD (\d\S+|<.+>) |
| 3 |
Value List INTERFACES ([\w\./-]+) |
| 4 |
|
| 5 |
Start |
| 6 |
^\s+V[rR][fF]\s+RD\s+Protocols\s+State\s+Interfaces -> VRF |
| 7 |
^Maximum |
| 8 |
^\s*$$ |
| 9 |
^. -> Error |
| 10 |
|
| 11 |
VRF |
| 12 |
# match a vrf with interfaces |
| 13 |
# key on the first line of a VRF |
| 14 |
^\s+\S+\s+(\d\S+|<.+>)\s+\S+\s+(\S+:?\S+(?:\s\S+)*).*$$ -> Continue.Record |
| 15 |
# |
| 16 |
################# First lines of VRF ################### |
| 17 |
# |
| 18 |
# match first line of vrf, first interface and it is the last interface |
| 19 |
^\s+${VRF}\s+${RD}\s+\S+\s+\S+:\S+(\s\S+)*,?\s+${INTERFACES}\s*$$ -> Continue |
| 20 |
# |
| 21 |
# match first line of a vrf, first interface and it is not the last interface |
| 22 |
^\s+${VRF}\s+${RD}\s+\S+\s+\S+:\S+(\s\S+)*,\s+${INTERFACES}, -> Continue |
| 23 |
# |
| 24 |
# match first line of a vrf, second interface and it is the last interface |
| 25 |
# two interfaces displayed per line |
| 26 |
^\s+\S+\s+\S+(\s\S+)*\s+\S+\s+\S+:\S+(\s\S+)*,?\s+(?:\S+,\s){1}${INTERFACES}\s*$$ -> Continue |
| 27 |
# |
| 28 |
# match first line of a vrf, third interface and it is the last interface |
| 29 |
# three interfaces displayed per line |
| 30 |
^\s+\S+\s+\S+(\s\S+)*\s+\S+\s+\S+:\S+(\s\S+)*,?\s+(?:\S+,\s){2}${INTERFACES}\s*$$ -> Continue |
| 31 |
# |
| 32 |
# match first line of a vrf, second interface when there are more than two interfaces |
| 33 |
# two or three interfaces displayed per line |
| 34 |
^\s+\S+\s+\S+(\s\S+)*\s+\S+\s+\S+:\S+(\s\S+)*,?\s+(?:\S+,\s){1}${INTERFACES}, -> Continue |
| 35 |
# |
| 36 |
# match first line of a vrf, third interface when there are more than three Interfaces |
| 37 |
# three interfaces displayed per line |
| 38 |
^\s+\S+\s+\S+(\s\S+)*\s+\S+\s+\S+:\S+(\s\S+)*,?\s+(?:\S+,\s){2}${INTERFACES}, -> Continue |
| 39 |
# |
| 40 |
############## Lines that contains state ################## |
| 41 |
# |
| 42 |
# match state only line |
| 43 |
^\s+(\S+:\S+(?:\s\S+)*)\s*$$ |
| 44 |
# |
| 45 |
# match first interface of the line when it also has a state and it is the last interface |
| 46 |
^\s+(\S+:\S+(?:\s\S+)*)\s+${INTERFACES}?\s*$$ -> Continue |
| 47 |
# |
| 48 |
# match first interface of the line when it also has a state and it is not the last interface |
| 49 |
^\s+\S+:\S+(\s\S+)*\s+${INTERFACES}, -> Continue |
| 50 |
# |
| 51 |
# match second interface of the line when it also has a state and it is the last interface |
| 52 |
# two interfaces displayed per line |
| 53 |
^\s+\S+:\S+(\s\S+)*\s+(?:\S+,\s){1}${INTERFACES}\s*$$ -> Continue |
| 54 |
# |
| 55 |
# match third interface of the line when it also has a state and it is the last interface |
| 56 |
# three interfaces displayed per line |
| 57 |
^\s+\S+:\S+(\s\S+)*\s+(?:\S+,\s){2}${INTERFACES}\s*$$ -> Continue |
| 58 |
# |
| 59 |
# match second interface of the line when it also has a state and it is not the last interface |
| 60 |
# two or three interfaces displayed per line |
| 61 |
^\s+\S+:\S+(\s\S+)*\s+(?:\S+,\s){1}${INTERFACES}, -> Continue |
| 62 |
# |
| 63 |
# match third interface of the line when it also has a state and it is not the last interface |
| 64 |
# three interfaces displayed per line |
| 65 |
^\s+\S+:\S+(\s\S+)*\s+(?:\S+,\s){2}${INTERFACES}, -> Continue |
| 66 |
# |
| 67 |
################# Lines that have whitespace preceding the interface list #################### |
| 68 |
# |
| 69 |
# |
| 70 |
# match first interface of the line when it only has whitespace and it is the last interface |
| 71 |
^\s+${INTERFACES}\s*$$ -> Continue |
| 72 |
# |
| 73 |
# match first interface of the line when it only has whitespace and it is not the last interface |
| 74 |
^\s+${INTERFACES}, -> Continue |
| 75 |
# |
| 76 |
# match second interface of the line when it only has whitespace and it is the last interface |
| 77 |
# two interfaces displayed per line |
| 78 |
^\s+(?:\S+,\s){1}${INTERFACES}\s*$$ -> Continue |
| 79 |
# |
| 80 |
# match third interface of the line when it only has whitespace and it is the last interface |
| 81 |
# three interfaces displayed per line |
| 82 |
^\s+(?:\S+,\s){2}${INTERFACES}\s*$$ -> Continue |
| 83 |
# |
| 84 |
# match second interface of the line when it only has whitespace and it is not the last interface |
| 85 |
# two or three interfaces displayed per line |
| 86 |
^\s+(?:\S+,\s){1}${INTERFACES}, -> Continue |
| 87 |
# |
| 88 |
# match third interface of the line when it only has whitespace and it is not the last interface |
| 89 |
# three interfaces displayed per line |
| 90 |
^\s+(?:\S+,\s){2}${INTERFACES}, -> Continue |
| 91 |
# |
| 92 |
################## For vrfs without interfaces ################### |
| 93 |
# |
| 94 |
# match vrf line with no interfaces |
| 95 |
^\s+${VRF}\s+${RD}\s+\S+\s+\S+:\S+(\s\S+)*,?\s+$$ |