in reply to Pattern Match/Trim Variables.
And, then, since the date format is fixed, just match up until the period.$line =~ tr/\t\n\r"/\x09\x0A\x0D'/;
$line =~ s{ ( # start capturing into $1 [\d|/|\s|:]+ # match digits, # forward slashes, spaces, # or colons 1 or more times ) \. # stop capturing into $1 # when you hit a period \d\d\d} # match three more digits {$1}x; # replace it all w/ $1
|
|---|