Refactoring the way the regex delimiters are added/removed