Pattern Matching #262
damodaranr
started this conversation in
Ideas
Replies: 1 comment
-
@damodaranr please see the custom operators example for how to implement this: https://github.com/CacheControl/json-rules-engine/blob/master/examples/06-custom-operators.js |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Could we get regex pattern matching for strings please?
I did extend the engine-default-operator.js and operator.json in the associated editor project to allow this:
Operators.push(new _operator2.default('pattern', function (a, b) {
return new RegExp(b, 'gim').test(a);
}));
Operators.push(new _operator2.default('notPattern', function (a, b) {
return !(new RegExp(b, 'gim').test(a));
}));
Beta Was this translation helpful? Give feedback.
All reactions