mirror of
https://gitee.com/openharmony/third_party_rust_regex
synced 2025-04-10 22:51:42 +00:00

This fixes yet another bug with our handling of (?flags) directives in the regex. This time, we try to be a bit more principled and specifically treat a (?flags) directive as a valid empty sub-expression. While this means we could remove errors reported from previous fixes for things like `(?i)+`, we retain those for now since they are a bit weird. Although `((?i))+` is now allowed, which is equivalent. We should probably allow `(?i)+` in the future for consistency sake. Fixes #527