Question

When developing regular expressions it helps not only to know what the limitations are as seen here: http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0a38f-7ff3.html , but also what the grammar and syntax expected is. It also helps during testing for apps that can select a Regex engine to test with against a test bed of text or files.

I've seen posted here and there that CF uses Jakarta ORO, http://jakarta.apache.org/oro/ , which is retired late 2010 so that can't be correct or is it still baked into CF9?

If CF10 ships with a different Regex engine as CF9 please also include if known.

Était-ce utile?

La solution

CF9 and CF10 both use Jakarta ORO v2.0.6 - changing it for the existing functions would break backwards compatibility, since other regex engines use different syntax (for both matching and replacement).

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

If you're not comfortable working with Java classes yourself, I have created a project which wraps the java.util.regex library into a set of handy CFML functions, see cfregex.net for more details.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top