s/^\s+\(Text [aA].* (\d+:\d+ .*$)/\.T1 "$1/g; #### %search ( 1 => "s/^\s+\(Text [aA].* (\d+:\d+ .*$)/", 2 => ..... ); $replace ( 1 => "/\.T1 \"$1/", 2 => ..... ); Now I'd like to do something like this, and I know qr// fits in to the equation, I just dont know how .... yet :) while { s/$search/$replace/g; }