在正则表达式世界中,Java使用的是什么味道和风味? [英] In the regex world what's a flavor and which flavor does Java use?

查看:99
本文介绍了在正则表达式世界中,Java使用的是什么味道和风味?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不是英语母语,所以我不太清楚味道的含义
可能是指的是正则表达式语法?如果有的话有多少正则表达式语法?

I'm not a native English and so I don't understand well the meaning of 'flavor' may be is it referred to a regex syntax?? and if so how many regex syntax are there?

BRE ERE Perl等。??

BRE ERE Perl etc.??

推荐答案


  • Flavor指的是正则表达式引擎 - 特定正则表达式引擎支持的语法和附加属性。

  • 模式类记录了 java正则表达式引擎

  • 除了元字符的含义等基本内容之外,正则表达式引擎的不同实现支持不同类型的语法。例如


    • POSIX引擎支持 [:digit:] 数字(与<$ c $相同) c> [0-9]

    • Perl兼容引擎支持 \d 数字的快捷方式。

    • JavaScript不支持外观

    • PHP和其他一些支持看后面,但需要它们固定长度

    • 文本编辑器的正则表达式引擎(Notepad ++)通常不支持环顾四周。

      • Flavor refers to the regex engine - the syntax and additional properties supported by the particular regex engine.
      • Pattern class documents the properties of the java regex engine
      • Aside from the basic things like the meaning of metacharacters, different implementations of regex engines support different types of syntaxes. For example
        • POSIX engines support [:digit:] for digits (same as [0-9]
        • Perl compatible engines support \d shortcut for digits.
        • JavaScript doesn't support look behinds
        • PHP and some others support look behinds, but needs them to be fixed length
        • Regex engines of text editors (Notepad++) generally don't support look around.
        • 这篇关于在正则表达式世界中,Java使用的是什么味道和风味?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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