- 浏览: 71176 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
george.gu:
lqjacklee 写道怎么解决。。 First: Conf ...
Bad version number in .class file -
lqjacklee:
怎么解决。。
Bad version number in .class file -
flyqantas:
would you pleade left more mate ...
UML Extension
In current Project, we need to parse log file (written by log4j) and extract dedicated information for future actions:
- Display info in GUI
- Analyze error and send mail to responder
- Backup key logs into DB which can be shared to external system
- ...
Regular Expression Semantics
Common Match Sysmbols
Description |
|
. |
Matches any sign |
^regex |
regex must match at the beginning of the line |
regex$ |
Finds regex must match at the end of the line |
[abc] |
Set definition, can match the letter a or b or c |
[abc[vz]] |
Set definition, can match a or b or c followed by either v or z |
[^abc] |
When a "^" appears as the first character inside [] when it negates the pattern. This can match any character except a or b or c |
[a-d1-7] |
Ranges, letter between a and d and figures from 1 to 7, will not match d1 |
X|Z |
Finds X or Z |
XZ |
Finds X directly followed by Z |
$ |
Checks if a line end follows |
Special Metacharacters
Description |
|
\d |
Any digit, short for [0-9] |
\D |
A non-digit, short for [^0-9] |
\s |
A whitespace character, short for [ \t\n\x0b\r\f] |
\S |
A non-whitespace character, for short for [^\s] |
\w |
A word character, short for [a-zA-Z_0-9] |
\W |
A non-word character [^\w] |
\S+ |
Several non-whitespace characters |
Quantifier
RE |
Description |
Examples |
* |
Occurs zero or more times, is short for {0,} |
X* - Finds no or several letter X, .* - any character sequence |
+ |
Occurs one or more times, is short for {1,} |
X+ - Finds one or several letter X |
? |
Occurs no or one times, ? is short for {0,1} |
X? -Finds no or exactly one letter X |
{X} |
Occurs X number of times, {} describes the order of the preceding liberal |
\d{3} - Three digits, .{10} - any character sequence of length 10 |
{X,Y} |
.Occurs between X and Y times, |
\d{1,4}- \d must occur at least once and at a maximum of four |
*? |
? after a qualifier makes it a "reluctant quantifier", it tries to find the smallest match. |
|
Java Regular Expression Usage
To be updated.
发表评论
-
javax.naming.CommunicationException: remote side declared peer gone on this JVM.
2012-07-11 09:44 2333javax.naming.ServiceUnavailable ... -
Generate special format numbers
2012-04-27 00:06 873DecimalFormat df = new DecimalF ... -
Singleton Service in Weblogic Cluster
2012-03-21 00:12 660http://blog.csdn.net/mobicents/ ... -
Scheduled ThreadPool Executor suppressed or stopped after error happen
2012-03-20 16:54 1007ScheduledThreadPoolExecutor ... -
Bad version number in .class file
2012-01-27 00:35 849Bad version number in .class fi ... -
User Data Header in SMPP SUBMIT_SM
2012-01-25 22:30 2302SMPP optional Parameters for ... -
jQuery study
2011-12-28 00:44 0to be study -
Java is Pass-by-Value or Pass-by-Reference?
2011-12-19 19:18 656What's saved in Object Referenc ... -
java.util.Properties: a subclass of java.util.Hashtable
2011-12-13 06:57 741I met a problem this afternoon ... -
Jmock usage
2011-12-02 05:37 0Discuss how Jmock working. -
Oracle Index Usage
2011-12-15 05:26 574Like a hash mapping for record' ... -
AOP(2):AOP与动态代理JDK Proxy and Cglib Proxy
2011-05-12 16:20 970使用动态代理(JDK Proxy 或者Cglib Proxy) ... -
AOP(1):应用中的几个小故事
2011-05-09 21:49 944I had heared about AOP almost 7 ... -
异步系统设计:push vs pull
2011-05-02 23:59 1112今天讨论问题时,有个同事说系统A是主动去系统B里“拿”消息,我 ... -
Velocity Usage
2011-04-28 22:52 967You can find velocity mannua ... -
XML Parser:DOM + XPath
2011-04-23 06:30 1160There are many kinds of XML Par ... -
File upload and download in Java Web Application.
2011-04-21 21:08 1675最近在项目中遇到一个下载文件的老问题。之所以说是老问题,因为在 ... -
Manage zip content using Java APIs
2011-04-21 18:14 987JDK provide a set of utils to c ... -
Beanshell: how and where to use beanshell
2011-04-21 00:33 2052How to use beanshell beansh ... -
OXM: JAXB2.0 in JDK1.6
2011-04-20 22:53 12061.1.1 JAXB 2.0: ObjectàXML ...
相关推荐
如果你不熟悉这个术语,那么“正则表达式”(Regular Expression)就是一个字符构成的串,它定义了一个用来搜索匹配字符串的模式。 许多语言,包括Perl、PHP、Python、JavaScript和JScript,都支持用正则表达式处理...
如果你曾经用过Perl或任何其他内建正则表达式支持的语言,你一定知道用正则表达式...如果你不熟悉这个术语,那么“正则表达式”(Regular Expression)就是一个字符构成的串,它定义了一个用来搜索匹配字符串的模式。
java正则表达式.docx 如果你曾经用过Perl或任何其他内建正则表达式支持的语言,你一定知道用正则表达式处理文本和匹配模式是多么简单。如果你不熟悉这个术语,那么“正则表达式”(Regular Expression)就是一个字符...
如果你不熟悉这个术语,那么“正则表达式”(Regular Expression)就是一个字符构成的串,它定义了一个用来搜索匹配字符串的模式。 许多语言,包括Perl、PHP、Python、JavaScript和JScript,都支持用正则表达式...
本文实例源码 博文链接:https://gmf.iteye.com/blog/89077
《精通正则表达式》是系统学习正则表达式的唯一最权威著作。任何时候,任何地方,只要提到正则表达式著作,人们都会提到这本书。该书质量之高,声誉之盛,使得几乎没有人企图挑战它的地位,从而在正则表达式图书领域...
一个非常完备,快速的Java正则表达式库,有详细的说明文档
正则表达式,又称规则...当然在Java中也可以通过处理字符串的方式达到检索,替换文本字符串的目的,但是有了正则表达式写代码更加简洁,通常两三行代码就可以达到目的,当然这也是建立在熟悉正则表达式的基础之上的。
正则表达式(regular expression)描述了一种字符串匹配的模式(pattern),可以用来检查一个串是否含有某种子串、将匹配的子串替换或者从某个串中取出符合某个条件的子串等。 例如: runoo+b,可以匹配 runoob、...
正则表达式(regular expression)是一种表示方式,最早在LINUX被当做一种搜索算法应用在编辑器中,后来被广泛应用,不仅PHP脚本支持正则表达式,Perl、C#、Java以及JavaScript和MySQL也对正则表达式支持。...
一个轻量级的正则表达式手册,对做Javascript开发, 或者使用JAVA做字符串的操作非常有用。
正则表达式袖珍手册(Regular Expression Pocket Reference: Regular Expressions for Perl, Ruby, PHP, Python, C, Java and .NET (Pocket Reference一书的译稿)
如果你不熟悉这个术语,那么“正则表达式”(Regular Expression)就是一个字符构成的串,它定义了一个用来搜索匹配字符串的模式。 正则表达式30分钟入门教程 常用正则表达式 许多语言,包括Perl、PHP、Python、...
这是Java正则表达式的测试工具支持在Google App Engine上运行。 它部署在下面的链接。 Java正则表达式测试器 用法 输入文字。 输入目标文本,正则表达式模式和替换(可选)。 点击“测试”按钮 单击“测试”按钮...