#!/usr/bin/perl use strict; use warnings; while ( my $line = ) { my @candidates = $line =~ m{ "([^"]+)" }xmsg; my @paths = grep{ m{/} }@candidates; print sprintf "found on line %s: %s\n", $., join ', ', @paths; } __DATA__ soundSet = { name = "bus_modern", horn = "vehicle/truck_modern/horn.wav" } id = "vehicle/bus/citaro/lod_0_w2.msh", "vehicle/bus/berkhof_duvedec/berkhof_duvedec_lod_0_w2.msh", "vehicle/bus/berkhof_duvedec/berkhof_duvedec_lod_0_w3.msh",