Utils functions to wrap regex replacement in additional groups