Reverting Regex optimizations

The replacement code was not equivalent and failed S7.6_A4.2_T2