Build, test, and debug regular expressions
This PCRE2 regex matches the space immediately following the first 'a.m.' or 'p.m.' in a time range formatted with an en-dash, such as '10 a.m. – 2 p.m.'. It uses a capturing group and a positive lookahead to ensure the matched space is followed by a dash, another time, and the exact same period abbreviation. It is highly useful for text cleanup operations to remove redundant time period markers before the dash.