Hi.

See inline comments..

[snip]

Here is my code.

1 $filename = 'This is a directory\file\sub.txt';
2 $regex = '\\(\w+\.\w+)$';

$regex = '\\(\w+\.\w+\)$';

Missed to escape the last ) ...

[snip]

However if I "copy/paste" the actual regexp from line 2 into line 3 and
not use the variable, the program works fine.

Yes, single versus double quotes.. may want to look up the differences.. :D Leaving that as an exercise for the reader..


//Anders//

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>

Reply via email to