A simple and easy to debug approach is to build your regular expression from other regular expressions that you have tested before. For example:
my $re_protocols = qr/ip|tcp|udp|object-group\s+(\w+)/; my $re_port = qr/eq\s+(\d+)|range\s+(\d+)\s+(\d+)|/; my $acl = qr/access-list \s+ (\w+) # name \s+ (\w+) # action \s+ ($re_protocols) \s+ # ... and so on /x;
In reply to Re: Regex to match a Cisco ACL
by Corion
in thread Regex to match a Cisco ACL
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |