Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-39697

Regex MatchExpression should error at parse time if the regex is not valid

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.1.9
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • Fully Compatible
    • Query 2019-03-11

      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.

            Assignee:
            ian.boros@mongodb.com Ian Boros
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: