Hi there,
How can we use regex in perl to store the Route Distinguisher (the bold field) and also the underlined and bold lines in the below file?
Note:
These highlighted pattern is redundant through the whole input file. Basically, we just need to extract these fields at least to store them for later use using RegEx in perl and each Route Disnguisher has to go in a hash as the key with its corresponding underlined network patterns as values? The header should be skipped.
thanks:D
Here's our input file:
Network Next Hop From AS Path
Route Distinguisher: 577:99
10.99.99.79/32 67.70.219.79 Local ?
Route Distinguisher: 577:10168
38.44.1.0/30 67.70.219.79 Local ?
192.85.111.0/24 38.44.1.1 38.44.1.1 65500 ?
Route Distinguisher: 700:700
8.8.8.8/32 70.70.70.1 70.70.70.1 65500 ?
9.9.9.9/32 70.70.70.1 70.70.70.1 65500 ?
10.10.10.1/32 70.70.70.1 70.70.70.1 65500 ?
50.0.0.0/8 80.80.80.1 80.80.80.1 65500 ?
70.70.70.0/30 70.70.70.1 Local ?
71.71.71.0/30 70.70.70.1 70.70.70.1 65500 ?
80.0.0.0/8 80.80.80.1 80.80.80.1 65500 ?
80.80.80.0/30 67.70.219.79 Local ?
81.81.81.1/32 70.70.70.1 70.70.70.1 65500 ?
90.0.0.0/30 70.70.70.1 70.70.70.1 65500 ?
90.90.90.1/32 70.70.70.1 70.70.70.1 65500 ?
91.0.0.0/30 70.70.70.1 70.70.70.1 65500 ?
91.91.91.1/32 70.70.70.1 70.70.70.1 65500 ?
130.130.130.1/32 70.70.70.1 70.70.70.1 65500 ?
167.70.219.245/32 70.70.70.1 70.70.70.1 65500 ?
172.26.0.0/16 80.80.80.1 80.80.80.1 65500 ?
172.26.150.0/25 70.70.70.1 70.70.70.1 65500 ?
172.26.150.192/26 70.70.70.1 70.70.70.1 65500 ?
192.85.43.0/24 80.80.80.1 80.80.80.1 65500 ?
192.85.44.0/24 70.70.70.1 70.70.70.1 65500 ?
192.85.46.0/24 70.70.70.1 70.70.70.1 65500 ?
192.168.7.0/30 70.70.70.1 70.70.70.1 65500 ?
192.168.8.0/30 70.70.70.1 70.70.70.1 65500 ?