Which RegEx engine is used in ColdFusion 9?

When developing regular expressions, this helps not only to find out what limitations exist here: http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0a38f-7ff3.html , but also that the grammar and syntax are expected. It also helps during testing applications that can select the Regex engine for testing with a test layer of text or files.

I saw here and where CF uses the Jakarta ORO, http://jakarta.apache.org/oro/ , which retired at the end of 2010, so it can't be right or still bake in CF9?

If the CF10 comes with another Regex engine as a CF9, please also indicate if it is known.

+6
source share
1 answer

CF9 and CF10 use Jakarta ORO v2.0.6 - changing it for existing functions will lead to a loss of backward compatibility, as other regular expression engines use different syntax (for matching and replacement).

However, you can access the java.util.regex package from CF, which provides access to the version of this engine that your JRE uses, using CreateObject / type = java

If you don't like working with Java classes yourself, I created a project that wraps the java.util.regex library in a set of convenient CFML functions, see cfregex.net for more details.

+16
source

Source: https://habr.com/ru/post/917134/


All Articles