We could just do a try/except.  If the original pattern doesn't work, try the patter with milliseconds.

If we want to use the regex, I would move the compile outside of the method so it gets done once and is reused in both places.