webstorm搜索說明

Summary of regular-expression constructs
Construct
Matches
 
Characters
x
The character x
\\
The backslash character
\0n
The character with octal value 0n (0 <= n <= 7)
\0nn
The character with octal value 0nn (0 <= n <= 7)
\0mnn
The character with octal value 0mnn (0 <= m <= 3, 0 <= n <= 7)
\xhh
The character with hexadecimal value 0xhh
\uhhhh
The character with hexadecimal value 0xhhhh
\t
The tab character ('\u0009')
\n
The newline (line feed) character ('\u000A')
\r
The carriage-return character ('\u000D')
\f
The form-feed character ('\u000C')
\a
The alert (bell) character ('\u0007')
\e
The escape character ('\u001B')
\cx
The control character corresponding to x
 
Character classes
[abc]
a, b, or c (simple class)
[^abc]
Any character except a, b, or c (negation)
[a-zA-Z]
a through z or A through Z, inclusive (range)
[a-d[m-p]]
a through d, or m through p: [a-dm-p] (union)
[a-z&&[def]]
d, e, or f (intersection)
[a-z&&[^bc]]
a through z, except for b and c: [ad-z] (subtraction)
[a-z&&[^m-p]]
a through z, and not m through p: [a-lq-z](subtraction)
 
Predefined character classes
.
Any character (may or may not match line terminators)
\d
A digit: [0-9]
\D
A non-digit: [^0-9]
\s
A whitespace character: [ \t\n\x0B\f\r]
\S
A non-whitespace character: [^\s]
\w
A word character: [a-zA-Z_0-9]
\W
A non-word character: [^\w]
 
POSIX character classes (US-ASCII only)
\p{Lower}
A lower-case alphabetic character: [a-z]
\p{Upper}
An upper-case alphabetic character:[A-Z]
\p{ASCII}
All ASCII:[\x00-\x7F]
\p{Alpha}
An alphabetic character:[\p{Lower}\p{Upper}]
\p{Digit}
A decimal digit: [0-9]
\p{Alnum}
An alphanumeric character:[\p{Alpha}\p{Digit}]
\p{Punct}
Punctuation: One of !"#$%&'()*+,-./:;=>?@[\]^_`{|}~
 
\p{Graph}
A visible character: [\p{Alnum}\p{Punct}]
\p{Print}
A printable character: [\p{Graph}\x20]
\p{Blank}
A space or a tab: [ \t]
\p{Cntrl}
A control character: [\x00-\x1F\x7F]
\p{XDigit}
A hexadecimal digit: [0-9a-fA-F]
\p{Space}
A whitespace character: [ \t\n\x0B\f\r]
 
java.lang.Character classes (simple java character type)
\p{javaLowerCase}
Equivalent to java.lang.Character.isLowerCase()
\p{javaUpperCase}
Equivalent to java.lang.Character.isUpperCase()
\p{javaWhitespace}
Equivalent to java.lang.Character.isWhitespace()
\p{javaMirrored}
Equivalent to java.lang.Character.isMirrored()
 
Classes for Unicode blocks and categories
\p{InGreek}
A character in the Greek block (simple block)
\p{Lu}
An uppercase letter (simple category)
\p{Sc}
A currency symbol
\P{InGreek}
Any character except one in the Greek block (negation)
[\p{L}&&[^\p{Lu}]] 
Any letter except an uppercase letter (subtraction)
 
Boundary matchers
^
The beginning of a line
$
The end of a line
\b
A word boundary
\B
A non-word boundary
\A
The beginning of the input
\G
The end of the previous match
\Z
The end of the input but for the final terminator, if any
\z
The end of the input
 
Greedy quantifiers
X?
X, once or not at all
X*
X, zero or more times
X+
X, one or more times
X{n}
X, exactly n times
X{n,}
X, at least n times
X{n,m}
X, at least n but not more than m times
 
Reluctant quantifiers
X??
X, once or not at all
X*?
X, zero or more times
X+?
X, one or more times
X{n}?
X, exactly n times
X{n,}?
X, at least n times
X{n,m}?
X, at least n but not more than m times
 
Possessive quantifiers
X?+
X, once or not at all
X*+
X, zero or more times
X++
X, one or more times
X{n}+
X, exactly n times
X{n,}+
X, at least n times
X{n,m}+
X, at least n but not more than m times
 
Logical operators
XY
X followed by Y
X|Y
Either X or Y
(X)
X, as a capturing group
 
Back references
\n
Whatever the nth capturing group matched
 
Quotation
\
Nothing, but quotes the following character
\Q
Nothing, but quotes all characters until \E
\E
Nothing, but ends quoting started by \Q
 
 
Special constructs (non-capturing)
(?:X)
X, as a non-capturing group
(?idmsux-idmsux) 
Nothing, but turns match flags on - off
(?idmsux-idmsux:X)  
X, as a non-capturing group with the given flags on - off
(?=X)
X, via zero-width positive lookahead
(?!X)
X, via zero-width negative lookahead
(?<=X)
X, via zero-width positive lookbehind
(?<!X)
X, via zero-width negative lookbehind
(?>X)
X, as an independent, non-capturing group
More on Regular Expressions: Full Java Regular Expressions syntax description, Using Regular Expressions in Java.
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末削茁,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌景馁,老刑警劉巖,帶你破解...
    沈念sama閱讀 217,406評論 6 503
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異板熊,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī)察绷,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,732評論 3 393
  • 文/潘曉璐 我一進(jìn)店門干签,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人拆撼,你說我怎么就攤上這事容劳。” “怎么了闸度?”我有些...
    開封第一講書人閱讀 163,711評論 0 353
  • 文/不壞的土叔 我叫張陵竭贩,是天一觀的道長。 經(jīng)常有香客問我莺禁,道長娶视,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 58,380評論 1 293
  • 正文 為了忘掉前任睁宰,我火速辦了婚禮,結(jié)果婚禮上寝凌,老公的妹妹穿的比我還像新娘柒傻。我一直安慰自己,他們只是感情好较木,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,432評論 6 392
  • 文/花漫 我一把揭開白布红符。 她就那樣靜靜地躺著,像睡著了一般伐债。 火紅的嫁衣襯著肌膚如雪预侯。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,301評論 1 301
  • 那天峰锁,我揣著相機(jī)與錄音萎馅,去河邊找鬼。 笑死虹蒋,一個(gè)胖子當(dāng)著我的面吹牛糜芳,可吹牛的內(nèi)容都是我干的飒货。 我是一名探鬼主播,決...
    沈念sama閱讀 40,145評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼峭竣,長吁一口氣:“原來是場噩夢啊……” “哼塘辅!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起皆撩,我...
    開封第一講書人閱讀 39,008評論 0 276
  • 序言:老撾萬榮一對情侶失蹤扣墩,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后扛吞,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體呻惕,經(jīng)...
    沈念sama閱讀 45,443評論 1 314
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,649評論 3 334
  • 正文 我和宋清朗相戀三年喻粹,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了蟆融。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 39,795評論 1 347
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡守呜,死狀恐怖型酥,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情查乒,我是刑警寧澤弥喉,帶...
    沈念sama閱讀 35,501評論 5 345
  • 正文 年R本政府宣布,位于F島的核電站玛迄,受9級特大地震影響由境,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜蓖议,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,119評論 3 328
  • 文/蒙蒙 一虏杰、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧勒虾,春花似錦纺阔、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,731評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至愕宋,卻和暖如春玻靡,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背中贝。 一陣腳步聲響...
    開封第一講書人閱讀 32,865評論 1 269
  • 我被黑心中介騙來泰國打工囤捻, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人雄妥。 一個(gè)月前我還...
    沈念sama閱讀 47,899評論 2 370
  • 正文 我出身青樓最蕾,卻偏偏與公主長得像依溯,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個(gè)殘疾皇子瘟则,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,724評論 2 354

推薦閱讀更多精彩內(nèi)容