in reply to RegExp help
So near :-)
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 Section
Seekers of Perl Wisdom