在ColdFusion 9中使用什么RegEx引擎? [英] What RegEx engine is used in ColdFusion 9?

查看:142
本文介绍了在ColdFusion 9中使用什么RegEx引擎?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当开发正则表达式时,它不仅有助于知道什么是限制,如这里所示: http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0a38f-7ff3.html ,以及预期的语法和语法。它还可以帮助测试应用程序,可以选择一个正则表达式引擎来测试与测试台的文本或文件。



我看过这里发布的CF使用Jakarta ORO, http://jakarta.apache.org/oro/ ,它将于2010年年底退役,因此无法



如果CF10附带一个不同的正则表达式引擎作为CF9,请还包括如果已知。


< CF9和CF10都使用Jakarta ORO v2.0.6 - 更改现有函数会破坏向后兼容性,因为其他正则表达式引擎使用不同的语法(用于匹配和替换)。



但是,您可以访问 java.util.regex 包,它提供对您的JRE使用的引擎的版本的访问,使用createObject/type=java



如果您不喜欢工作使用Java类本身,我创建了一个项目,它将java.util.regex库包装到一组方便的CFML函数中,请参见 cfregex.net for更多详情。


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.

解决方案

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.

这篇关于在ColdFusion 9中使用什么RegEx引擎?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆