in reply to (ar0n) Re: Regex Tagging (newbie)
in thread Regex Tagging (newbie)
Thanks ar0n. I see your point about the \w.
I've also tried printing $1.
So the regex isn't matching. I replaced mine with yours.
updatemy $now = time; $log_start=scalar localtime $now -1 * 86400; print "Log start = $log_start\n"; $log_start=~ s/^\w+\s+(\w+\s\d{1,2}\s\d{1,2}:\d{1,2}:\d{1,2})\s\d{4}$/ +$1/i; print "Modified Log start = $1\n";
Thanks to ar0n in CB, the correct regex is:
$log_start=~ s/^\w+\s+(\w+\s+\d{1,2}\s\d{1,2}:\d{1,2}:\d{1,2})\s\d{4}$ +/$1/i;
|
|---|