We attempted this improvement in SERVER-30986, the fix for which is present in 3.6.0 through 3.6.5 and 4.0.0. Due to a bug in the underlying PCRE library, this fix broke valid regular expressions which rely on some verbs (e.g. the UCP verb for configuring unicode support). See SERVER-34933 for details. This work was subsequently reverted, so recent versions of the 3.6 and 4.0 due not correctly reject invalid regular expressions.
SERVER-39693 tracks the work to fix the underlying issue in PCRE. Once SERVER-39693 is done, we can reintroduce parse-time validation of regular expressions in the MatchExpression library. We should also make sure that any new aggregation expressions which evaluate perl-compatible regexes error at parse time if the regex is invalid, but this work is tracked elsewhere.
- depends on
-
SERVER-39693 Fix bug in PCRE which reports error for valid regex
- Closed
- is related to
-
SERVER-34933 pcre verb support
- Closed
-
SERVER-30986 Server should error on invalid regex match expressions
- Closed
- related to
-
SERVER-51083 Problem with regex index bounds
- Closed
-
SERVER-39698 Make $regexFind, $regexFindAll, and $regexMatch error if the regex is invalid
- Closed