hyperjumptech / grule-rule-engine

Rule engine implementation in Golang
Other
2.16k stars 338 forks source link

Consider using the RE2 regex library #439

Open rafapcarvalho opened 6 months ago

rafapcarvalho commented 6 months ago

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,}