The other comments above are of course correct, but the insertion of a critical '?' (to prevent greedy matching) also seems to work:
Hope this helps,$line="some text \(\)\xA1 file.txt"; if ($line =~ /(.+?)\s*\(\)\xA1\s*(.+\.txt)/) { $file = $1; # $file =~ s/\s*$//; print ("<a href=\"$2\">$file</a><br>\n"); }
Tim
In reply to Re: RegExp help
by tfrayner
in thread RegExp help
by karmas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |