Previously simplify_regex() didn't handle trailing groups for regexp without the end of string character ("$").