startrule: network_object(s) ip: 'ip' '=' /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/ ip_nosemi: 'ip' '=' /\d{1,3}\.\d{1,3}\.\d{1,3}\.d{1,3}/ mask: /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3};/ host: /host:\w+/ '=' '{' ip(s) '}' host_range: /host:\w+/ '=' '{' 'range' '=' ip_nosemi '-' ip '}' hosts_or_range: host(s?) | host_range #hosts_or_range: host(s?) | host_range network_object: /network:(\w+)/ '=' '{' ip 'mask' '=' mask hosts_or_range '}' { print "Found network object named $item[1] " . "with IP $item{ip} and MASK $item{mask}\n"; }