I am trying to come up with a regular expression (for use with Java) that captures everything in a line except a list of IP addresses (17 at present). This is being done to verify that the configuration on a network device does not permit any IP address other than the allowed list.
The relevant text of the configuration should look like:
allowed-addresses { 1.1.1.1/32 2.2.2.2/28 3.3.3.3/27 }
I want to capture the extra addresses if the configuration is as below:
allowed-addresses { 1.1.1.1/32 2.2.2.2/28 3.3.3.3/27 4.4.4.4/12 ALL }
The desired expression should capture "4.4.4.4/32 ALL
" from the line above.