in reply to Re^4: Robocopy log parsing
in thread Robocopy log parsing
Beyond that, it may be that your intent and the regex's behavior don't agree. The \n is the wrong way to tackle the end of a line -- if, in fact, you need to anchor to an EOL... but you haven't offered any information to suggest it's needed at all.
So, perhaps you want something like this (after assigning a value to $dir):
$dir =~ m/([a-z:]+).*?/; $dir = $1; print $dir;The parens capture to $1 the content matching a-z & colon more than one time... for ex, "C:"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Robocopy log parsing
by bit5nip3r (Initiate) on May 29, 2012 at 09:22 UTC |