[SERVER-39697] Regex MatchExpression should error at parse time if the regex is not valid Created: 20/Feb/19  Updated: 29/Oct/23  Resolved: 28/Feb/19

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 4.1.9

Type: Improvement Priority: Major - P3
Reporter: David Storch Assignee: Ian Boros
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-39693 Fix bug in PCRE which reports error f... Closed
Related
related to SERVER-51083 Problem with regex index bounds Closed
related to SERVER-39698 Make $regexFind, $regexFindAll, and $... Closed
is related to SERVER-34933 pcre verb support Closed
is related to SERVER-30986 Server should error on invalid regex ... Closed
Backwards Compatibility: Fully Compatible
Sprint: Query 2019-03-11
Participants:

 Description   

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.



 Comments   
Comment by Githook User [ 28/Feb/19 ]

Author:

{'name': 'Ian Boros', 'username': 'puppyofkosh', 'email': 'puppyofkosh@gmail.com'}

Message: SERVER-39697 MatchExpressions regex error at parse time if regex is invalid
Branch: master
https://github.com/mongodb/mongo/commit/5f772b0b1139f4b9bbff098d4bcee59cf2e95cda

Generated at Thu Feb 08 04:52:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.