str.split("\\s+"),中的("\\s+")是什么东东? 昨天看到有人用str.split("\\s+")今天又看到"420348092".matches("\\d+")"fajsdkfjaskdfj".matches("\\w+");请问这些 "//什么的" 是什么东西?是不是正则表达式? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 正则表达式,\\d表示 0-9 的数字,\\s表示 空格,回车,换行等空白符,\\w表示单词字符(数字字母下划线)+号表示一个或多个的意思,所以... core java volume 1:c The character c \unnnn, \xnn, \0n, \0nn, \0nnn The code unit with the given hex or octal value \t, \n, \r, \f, \a, \e The control characters tab, newline, return, form feed, alert, and escape \cc The control character corresponding to the character c Character Classes [C1C2. . .] Any of the characters represented by C1, C2, . . . The Ci are characters, character ranges (c1-c2), or character classes [^. . .] Complement of character class [ . . . && . . .] Intersection of two character classes Predefined Character Classes . Any character except line terminators (or any character if the DOTALL flag is set) \d A digit [0-9] \D A nondigit [^0-9] \s A whitespace character [ \t\n\r\f\x0B] \S A non-whitespace character \w A word character [a-zA-Z0-9_] \W A nonword character \p{name} A named character class—see Table 12-9 \P{name} The complement of a named character class Boundary Matchers ^ $ Beginning, end of input (or beginning, end of line in multiline mode) \b A word boundary \B A nonword boundary Syntax Explanation \A Beginning of input \z End of input \Z End of input except final line terminator \G End of previous match Quantifiers X? Optional X X* X, 0 or more times X+ X, 1 or more times X{n} X{n,} X{n,m} X n times, at least n times, between n and m times Quantifier Suffixes ? Turn default (greedy) match into reluctant match + Turn default (greedy) match into possessive match Set Operations XY Any string from X, followed by any string from Y X|Y Any string from X or Y Grouping (X) Capture the string matching X as a group \n The match of the nth group Escapes \c The character c (must not be an alphabetic character) \Q . . . \E Quote . . . verbatim (? . . . ) Special construct—see API notes of Pattern class 多谢。kobe082005() ( ) 信誉:100 Blog 这些资料是从哪里找来的? 不看java JDK的java程序员是不合格的! 不看java JDK的java程序员是不合格的!==================================说的好 SCJP考题一道:按位异或 运算符 与boolean值 给一个有特定格式的String,如何对他加工,才可以调用PreparedStatement.setTimestamp(); 網頁與java的class架檔使用 能否将 byte[] 转为 File? 关于dll的问题! paint()和paintComponent()有什么区别? 希望有人解释一下这个简单程序的循环流程 初学 碰到问题了,谢谢 大虾指点!! 初级:NoClassDefFoundError错误。 怎么把double型的转成string 请教一个关于JAVA读取数据库的问题? 帮忙解决个netbeans的问题,谢谢啊
\\d表示 0-9 的数字,
\\s表示 空格,回车,换行等空白符,
\\w表示单词字符(数字字母下划线)
+号表示一个或多个的意思,所以...
c
The character c
\unnnn, \xnn, \0n, \0nn, \0nnn
The code unit with the given hex or octal value
\t, \n, \r, \f, \a, \e
The control characters tab, newline, return, form feed, alert, and escape
\cc
The control character corresponding to the character c
Character Classes
[C1C2. . .]
Any of the characters represented by C1, C2, . . . The Ci are characters, character ranges (c1-c2), or character classes
[^. . .]
Complement of character class
[ . . . && . . .]
Intersection of two character classes
Predefined Character Classes
.
Any character except line terminators (or any character if the DOTALL flag is set)
\d
A digit [0-9]
\D
A nondigit [^0-9]
\s
A whitespace character [ \t\n\r\f\x0B]
\S
A non-whitespace character
\w
A word character [a-zA-Z0-9_]
\W
A nonword character
\p{name}
A named character class—see Table 12-9
\P{name}
The complement of a named character class
Boundary Matchers
^ $
Beginning, end of input (or beginning, end of line in multiline mode)
\b
A word boundary
\B
A nonword boundary
Syntax
Explanation
\A
Beginning of input
\z
End of input
\Z
End of input except final line terminator
\G
End of previous match
Quantifiers
X?
Optional X
X*
X, 0 or more times
X+
X, 1 or more times
X{n} X{n,} X{n,m}
X n times, at least n times, between n and m times
Quantifier Suffixes
?
Turn default (greedy) match into reluctant match
+
Turn default (greedy) match into possessive match
Set Operations
XY
Any string from X, followed by any string from Y
X|Y
Any string from X or Y
Grouping
(X)
Capture the string matching X as a group
\n
The match of the nth group
Escapes
\c
The character c (must not be an alphabetic character)
\Q . . . \E
Quote . . . verbatim
(? . . . )
Special construct—see API notes of Pattern class
==================================
说的好