if ($text =~ /($searchString)/) { $_ = $1; s/!CR!/\n/g; print "$_\n"; } else { print "No match\n"; }