Complete regular-expression-matching