ColdFusion 9 中使用什么 RegEx 引擎? [英] What RegEx engine is used in ColdFusion 9?
问题描述
在开发正则表达式时,它不仅有助于了解以下限制是什么:http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0a38f-7ff3.html ,还有预期的语法和句法.它还有助于测试可以选择正则表达式引擎以针对文本或文件测试平台进行测试的应用.
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.
我在这里和那里看到过 CF 使用 Jakarta ORO,http://jakarta.apache.org/oro/ ,它已于 2010 年底退役,因此不正确还是仍被纳入 CF9?
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?
如果 CF10 附带与 CF9 不同的正则表达式引擎,请在已知的情况下也包括在内.
If CF10 ships with a different Regex engine as CF9 please also include if known.
推荐答案
CF9 和 CF10 都使用 Jakarta ORO v2.0.6 - 为现有函数更改它会破坏向后兼容性,因为其他正则表达式引擎使用不同的语法(匹配和替换).
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).
但是,您可以访问 java.util.regex 来自 CF 的包,它提供对 JRE 使用的引擎版本的访问,使用 createObject/type=java
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
如果您自己不习惯使用 Java 类,我创建了一个项目,它将 java.util.regex 库包装到一组方便的 CFML 函数中,请参阅 cfregex.net 了解更多详情.
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.
这篇关于ColdFusion 9 中使用什么 RegEx 引擎?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!