Add the match all group flags to regex replace