This regex substitution should be done in the list comprehension that process the lines because there are parts of the code that expects the output being a list of lines not a single string