Skip to content
← Back to activity

Public problem

ConfigCat email contains targeting rule with + sign throws invalid regular expression SyntaxError

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

getAllValuesAsync throws an "invalid regular expression" SyntaxError when an "email contains" targeting rule has a value containing a + sign, for example an email address. The + was being interpolated into the generated regex without escaping, breaking evaluation for every function that runs the value evaluator.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

This was a ConfigCat SDK bug in how targeting-rule values were escaped when building the comparison regex. The team confirmed the root cause and shipped a patched SDK version shortly after the report. Upgrade the configcat-js (or your platform SDK) to a release newer than February 2022 and targeting rules with + in the value evaluate correctly.

Source: https://github.com/configcat/js-sdk/issues/51

Source: https://github.com/configcat/js-sdk/issues/51