in reply to Re^2: regex not working
in thread regex not working

To me this last expression will not match if a . is indeed present.

So if you don't know wether or not the milliseconds have a decimal part or not you could do :

/^(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+(?:\.\d+)?)$/

$6 will then hold the ms, with or without the optional decimal part.