Construct
Matches
Characters
x |
The characterx
|
\\ |
The backslash character |
\0n
|
The character with octal value0n(0<=n<=7) |
\0nn
|
The character with octal value0nn(0<=n<=7) |
\0mnn
|
The character with octal value0mnn(0<=m<=3,
0<=n<=7) |
\xhh
|
The character with hexadecimalvalue0xhh
|
\uhhhh
|
The character with hexadecimalvalue0xhhhh
|
\t |
The tab character ('\ ') |
\n |
The newline (line feed) character ('\ ') |
\r |
The carriage-return character ('\ ') |
\f |
The form-feed character ('\ ') |
\a |
The alert (bell) character ('\') |
\e |
The escape character ('\') |
\cx
|
The control character corresponding tox
|
Character classes
[abc] |
a,b, orc(simple class) |
[^abc] |
Any character excepta,b, orc(negation) |
[a-zA-Z] |
athroughzorAthroughZ, inclusive (range) |
[a-d[m-p]] |
athroughd, ormthroughp:[a-dm-p](union) |
[a-z&&[def]] |
d,e, orf(intersection) |
[a-z&&[^bc]] |
athroughz, except forbandc:[ad-z](subtraction) |
[a-z&&[^m-p]] |
athroughz, and notmthroughp:[a-lq-z](subtraction) |
Predefined character classes
. |
Any character (may or may not matchline terminators) |
\d |
A digit:[0-9]
|
\D |
A non-digit:[^0-9]
|
\s |
A whitespace character:[ \t\n\x0B\f\r]
|
\S |
A non-whitespace character:[^\s]
|
\w |
A word character:[a-zA-Z_0-9]
|
\W |
A non-word character:[^\w]
|
POSIX character classes (US-ASCII only)
\p{Lower} |
A lower-case alphabetic character:[a-z]
|
\p{Upper} |
An upper-case alphabetic character:[A-Z]
|
\p{ASCII} |
All ASCII:[\x00-\x7F]
|
\p{Alpha} |
An alphabetic character:[\p{Lower}\p{Upper}]
|
\p{Digit} |
A decimal digit:[0-9]
|
\p{Alnum} |
An alphanumeric character:[\p{Alpha}\p{Digit}]
|
\p{Punct} |
Punctuation: One of!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
|
\p{Graph} |
A visible character:[\p{Alnum}\p{Punct}]
|
\p{Print} |
A printable character:[\p{Graph}]
|
\p{Blank} |
A space or a tab:[ \t]
|
\p{Cntrl} |
A control character:[\x00-\x1F\x7F]
|
\p{XDigit} |
A hexadecimal digit:[0-9a-fA-F]
|
\p{Space} |
A whitespace character:[ \t\n\x0B\f\r]
|
Classes for Unicode blocks and categories
\p{InGreek} |
A character in the Greekblock (simpleblock) |
\p{Lu} |
An uppercase letter (simplecategory) |
\p{Sc} |
A currency symbol |
\P{InGreek} |
Any character except one in the Greek block (negation) |
[\p{L}&&[^\p{Lu}]] |
Any letter except an uppercase letter (subtraction) |
Boundary matchers
^ |
The beginning of a line |
$ |
The end of a line |
\b |
A word boundary |
\B |
A non-word boundary |
\A |
The beginning of the input |
\G |
The end of the previous match |
\Z |
The end of the input but for the finalterminator,
ifany |
\z |
The end of the input |
Greedy quantifiers
X?
|
X, once or not at all |
X*
|
X, zero or more times |
X+
|
X, one or more times |
X{n}
|
X, exactlyntimes |
X{n,}
|
X, at leastntimes |
X{n,m}
|
X, at leastnbut not more thanmtimes |
Reluctant quantifiers
X??
|
X, once or not at all |
X*?
|
X, zero or more times |
X+?
|
X, one or more times |
X{n}?
|
X, exactlyntimes |
X{n,}?
|
X, at leastntimes |
X{n,m}?
|
X, at leastnbut not more thanmtimes |
Possessive quantifiers
X?+
|
X, once or not at all |
X*+
|
X, zero or more times |
X++
|
X, one or more times |
X{n}+
|
X, exactlyntimes |
X{n,}+
|
X, at leastntimes |
X{n,m}+
|
X, at leastnbut not more thanmtimes |
Logical operators
XY |
Xfollowed byY
|
X|Y
|
EitherXorY
|
(X)
|
X, as acapturing group
|
Back references
\n
|
Whatever thenthcapturing
groupmatched |
Quotation
\ |
Nothing, but quotes the following character |
\Q |
Nothing, but quotes all characters until\E
|
\E |
Nothing, but ends quoting started by\Q
|
Special constructs (non-capturing)
(?:X)
|
X, as a non-capturing group |
(?idmsux-idmsux) |
Nothing, but turns match flags on - off |
(?idmsux-idmsux:X)
|
X, as anon-capturing
groupwith the given flags on - off |
(?=X)
|
X, via zero-width positive lookahead |
(?!X)
|
X, via zero-width negative lookahead |
(?<=X)
|
X, via zero-width positive lookbehind |
(?<!X)
|
X, via zero-width negative lookbehind |
(?>X)
|
X, as an independent, non-capturing group |
相关推荐
可用于Eclipse的正则表达式插件,要求已安装JVM
通过正则表达式生成满足条件的随机数据
正则表达式的替换.php 正则表达式的替换 正则表达式的拆分.php 正则表达式的拆分 表单验证.php 表单验证 UBBCode....
eclipse正则表达式插件regex util
正则表达式调试编辑器, eclipse插件Regex Util,装好后,即可从视图打开Regex Util视图了,比较好用!
正则表达式的java应用 为eclipse的工程文件。
eclipse regex正则表达式插件
正则表达式测试工具正则表达式测试工具,使用Java开发,方便跨平台离线使用.Java,Python和C#当前支持正则表达式实现引擎,当前版本为beta。使用JavaFX 11组件开发,请遵循BSD协议,您可以免费获取和修改该程序,...
词法分析程序生成器实现将正则表达式、NFA、DFA、DFA最小化词法分析程序 词法分析程序生成器是一个工具,它能够根据给定的正则表达式自动生成词法分析器。这个生成器通常包括以下几个步骤:正则表达式的转换、NFA...
eclipse插件 正则表达式.可以各种模式匹配,便于开发
eclipse插件正则表达式
您可能感兴趣的文章:javascript匹配js中注释的正则表达式代码php使用正则表达式去掉html中的注释方法删除javascript中注释语句的正则表达式使用正则表达式匹配tsql注释语句javascipt匹配单行和多行注释的正则表达式...
主要介绍了Eclipse使用正则表达式快速修改代码的方法,本文给大家介绍的非常详细,具有一定的参考借鉴价值,需要的朋友可以参考下
在eclipse等java开发工具中写CSS的验证检查工具。很好的
想象一下,有一个带有正则表达式模式的 Java 文件,例如:“My\\s\”product\”\\scosts\\$\\d+\\.\\d{2}” 要在原始的 QuickREx 中使用它复制模式,将其粘贴到插件输入字段并删除所有转义的 1 级: My\s"product"\...
在 Visual Studio 和 Eclipse 中,统计代码行数可以通过使用正则表达式和搜索功能来实现。 Visual Studio 中的代码行数统计 在 Visual Studio 中,可以使用 "Find in Files" 功能来统计代码行数。具体步骤如下: ...
自动机Clojure库,使用从NFA到DFA的经典方法来实现正则表达式。 该库仅用于学习目的,请勿在生产中使用。用法导入使用(use automata.core) 您可以使用regex-nfa和regex宏定义正regex-nfa regex 。 例子: ( regex-...
安装方法:Eclipse3.5+ ,... OpenExplorer:Eclipse中快速打开本地文件系统 PropertiesEditor:Properties文件编辑工具,方便支持中文 RegexUtil:正则表达式验证 Spket:javascript语法提示支持 SVN:SVN操作支持