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;