我一直是使用regexbuddy生成各种语言的正则代码的,今天在匹java的时候遇到点问题,结果我还怀疑regexbuddy了,
try {
boolean foundMatch = subjectString.matches("[^a-zA-Z0-9]$");
} catch (PatternSyntaxException ex) {
// Syntax error in the regular expression
}
使用上面这段代码不成
String subjectString="192792720-4 #";
try {
Pattern regex = Pattern.compile("[^a-zA-Z0-9]$");
Matcher regexMatcher = regex.matcher(subjectString);
if (regexMatcher.find()) {
// Successful match
System.out.println("zzzz");
} else {
// Match attempt failed
}
} catch (PatternSyntaxException ex) {
// Syntax error in the regular expression
}
System.out.println("ddd");
结果换了一种方式也折腾近半个小时才成,真是怪怪,~~
最近用鼠标,发现有点鼠标手了,订了个鼠标垫,在淘宝上,京东的好看的太贵了,便宜的也20-30我不如弄个淘宝更便宜的山寨的,好,订了,周一上班时收货,呵呵