Try saying out loud what you want to match: I want everything from the beginning of the line to the last backslash,
^.*\\
then possibly some more stuff
.*
and then the end of the line.
$
So, seems like it oughta be:
if ( $line =~ m/^(.*)\\.*$/ ) { ... }
As long as the directory-only lines always end with a backslash. Does that one work for you?
In reply to Re: Reg Exp help
by Anonymous Monk
in thread Reg Exp help
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |