Written by

Question omer · Nov 24, 2024

Intersystems REGEX engine

I am working on a product that uses REGEX and matches it. 
The regex is tested both on the client-side (using the JavaScript REGEX engine) and both on the server-side.
But I couldn't find one word about the way intersystems parses the regex, It is quite elementary to state which which engine it works with. 
from what I could gather from early implementations and such, the engine is based off PCRE, But I need to confirm this somehow, Can anyone give me a definitive answer, Is there any tool to test the regex other than writing it myself??
 

And just to clarify, YES - i found values that would test false in client but test true on server and vice versa, For the exact same regex, So obviously the engine is different..

* My goal is to be able to craft unified regex for both engines to avoid duplicate regex that required maintance...

Product version: IRIS 2020.1

Comments

Jeffrey Drumm · Nov 24, 2024

The IRIS regex functionality is built on the ICU engine, which was based on (but does not rigorously adhere to) PCRE. This includes the ObjectScript $MATCH() and $LOCATE() functions as well as the %Regex.Matcher class. A web search turns up a handful of articles and posts discussing the differences between the two.

Python has a PCRE library (python-pcre) that may help if your development effort can be transitioned in whole or part to Python.

0
Steven Hobbs · Nov 25, 2024

The Class Reference pages for IRIS, available in any IRIS installation, describe all the classes installed in the installation.  The Class Reference for the %Regex.Matcher class documents that the %Regex.Matcher class comes from the International Components for Unicode (ICU). The ICU maintains web pages at https://icu.unicode.org .  The class reference documentation also contains the following statement for ICU documentation specific to the IRIS %Regex:

{quote}The definition and features of the ICU regular expression package can be found in https://unicode-org.github.io/icu/userguide/strings/regexp.html .{quote}

Additional documentation on the Unicode Regex package specific to how it interacts with the Unicode character set can be found at https://www.unicode.org/reports/tr18/ .

0