我遇到了一个java正则表达式问题。
如何找到1个或多个数字后跟单个数字的模式。在字符串中?
发布于 2012-06-08 16:06:17
我想这就是你问题的答案:
String searchText = "asdgasdgasdg a121341234.sdg asdg as12..dg a1234.sdg ";
searchText.matches("\\d+\\.[^.]");
这将匹配“121341234”。和“1234”但不是“12”
发布于 2012-06-08 16:05:26
"^[\\d]+[\\.]$"
^ = start of string
[\\d] = any digit
+ = 1 or more ocurrences
\\. = escaped dot char
$ = end of string
发布于 2012-06-08 16:02:47
https://stackoverflow.com/questions/10952264
复制