Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图编写一个正则表达式来验证以下字符串, 早上好 <3 个空格
我尝试的正则表达式是\s{2,}。但是正则表达式匹配失败
字符串必须完全匹配
"Good morning".matches(".*\\s{2}.*");
“\早上好\Z”怎么样?
这似乎太明显了,但它确实有效。
".*\s\s.*"