grule-rule-engine icon indicating copy to clipboard operation
grule-rule-engine copied to clipboard

Consider using the RE2 regex library

Open rafapcarvalho opened this issue 2 years ago • 0 comments

I'm working on a project where we plan to replace our custom algorithm in some scenarios with a rule engine, and among a few options, I suggested using this one.
In the first Proof of Concept (PoC), I needed to make a modification to achieve the same result as in Java aplication, and that involved using the RE2 regex, where I had to switch the default library to one that can handle lookaheads and lookbehinds.

However, I wouldn't like to continue the project with an in-house fork within the company.

Would it be possible to consider adding a default function that utilizes the RE2 regex? This way, we could maintain the current regex and have a separate new function that supports RE2.

The library I used and worked well is: "github.com/dlclark/regexp2". If you know of another one with more frequent updates, that would be good to explore.

Example expression not supported by the Go standard library: ^00(?!56)[1-9][0-9]{7,}

rafapcarvalho avatar Mar 01 '24 18:03 rafapcarvalho