How can I replace \s+ to single spance, all ; to ,, all a.m to AM, all x to y
I am new to named group replacement, how could I replace set of characters to the set of replacement characters using single RegEx and single sub() calling.
If I can keep all replacement strings in a dict and have a single RegEx string that could be the smart way.
Eg: M-Th 5:30 am-10 pm; F 5:30 a.m-10:30 p.m, Sa 10:30-10:30, Su 10:30-10 x y z x
Output: M-Th 5:30 AM-10 PM, F 5:30 AM - 10:30 PM, Sa 10:30 - 10:30, Su 10:30-10 y y z y
try this,
OUTPUT