GDa*_*ger 8 java regex
I'm trying to use some regex in Java and I came across this when debugging my code.
What's the difference between [.] and .?
[.]
.
I was surprised that .at would match "cat" but [.]at wouldn't.
.at
[.]at
fal*_*tru 19
[.].从字面上匹配一个点(),同时.匹配除换行符(\n)之外的任何字符(除非你使用DOTALL模式).
\n
DOTALL
您还可以使用\.("\\."如果您使用java字符串文字)字面匹配点.
\.
"\\."
归档时间:
12 年,3 月 前
查看次数:
736 次
最近记录:
12 年,2 月 前