perl和java正则表达式功能有什么区别? [英] What are the differences between perl and java regex capabilities?

查看:119
本文介绍了perl和java正则表达式功能有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于支持哪些正则表达式术语,perl和java之间有什么区别?

What are the differences between perl and java with regard to what regular expression terms are supported?

此问题仅与正则表达式隔离,具体排除了差异在中如何使用正则表达式 - 即使用正则表达式的可用函数/方法 - 以及诸如java要求之间的语法差异以逃避反斜杠等。

This question is isolated to just the regular expressions, and specifically excludes differences in how regex can be used - ie the functions/methods available that use regex - and syntactic differences between the languages such as the java requirement to escape backslashes etc.

特别感兴趣的是java对可变长度后视的部分/偶尔支持。

Of particular interest is the partial/occasional support java has for variable length look-behinds.

推荐答案

比较 java的Perl 5部分.util.regex.Pattern 列出了许多不同之处。例如,Java不支持条件正则表达式。为此,您需要使用一些外部库,如 JRegex

The "Comparison to Perl 5" section of java.util.regex.Pattern lists many differences. For example, Java does not support conditional regex. For that, you need to use some external library like JRegex.

这篇关于perl和java正则表达式功能有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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