Back out addition of g param in regex