Generalize regular expression.