【发布时间】:2013-10-31 01:18:50
【问题描述】:
我有一些代码:
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.lang.StringUtils;
private boolean validateEmail(...)
Pattern p = Pattern.compile("^((?:(?:(?:[a-zA-Z0-9][\\.\\-\\+_]?)*)[a-zA-Z0-9])+)\\@((?:(?:(?:[a-zA-Z0-9][\\.\\-_]?){0,62})[a-zA-Z0-9])+)\\.([a-zA-Z0-9]{2,6})$");
Matcher m = p.matcher(fieldValue);
boolean matches = m.matches();
if (!matches) {
// show not valid msg...
}
return matches;
}
^((?:(?:(?: 和 ((?:(?:(?: 在该模式中是什么意思?
^ 字符表示否定(全部没有)但其他字符?
【问题讨论】:
-
the documentation 告诉你他们的意思是什么?
-
他们在微笑——这就是正则表达式表达对你的同情的方式。
-
更明确地说,它们是讽刺的微笑。