use v5.10; my $acl_rx = qr{ (?&acl) # match one of these # according to these "regex sub" definitions: (?(DEFINE) (? access_list (?&interface_name) (?&action) (?&protocol) (?&source) (?&destination) (?&port) ) (? permit | deny ) (? tcp | udp | ip | object-group (?&object_group_name) ) (? object-group (?&object_group_name) | host (?&host_address) | (?&network_address) (?&net_mask) ) (? object-group (?&object_group_name) | host (?&host_address) | (?&network_address) (?&net_mask) ) (? eq (?&port_number) | range (?&low_port) (?&high_port) | ) (? (?&chunk) ) (? (?&chunk) ) (? (?&chunk) ) (? (?&chunk) ) (? (?&chunk) ) (? (?&chunk) ) (? (?&chunk) ) (? (?&chunk) ) (? (?&ws) \S+ (?&ws) ) (? \s* ) ) }x;