open (FH,"test.test") or die; while() { if ($_ =~ /"(.+?)"/) { print "Matched: $1\n"; s/$1/New string/; } print; }