patch regular expression more general