Test, validate and match regular expressions
This regex matches the milliseconds portion of an ISO 8601 datetime string: a literal dot followed by exactly three digits and a trailing 'Z' (UTC designator) at the end of the string. It's commonly used with replace() to strip sub-second precision from timestamps like '2024-01-15T10:30:45.123Z', converting them to '2024-01-15T10:30:45'. Useful for normalizing dates for display or APIs that don't accept millisecond precision. Tip: replace the match with 'Z' if you want to preserve the UTC indicator.