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.
你能说出这个模式在java中的作用吗?
private static final String PASSWORD_PATTERN = "^.[\\S]{5,}$";
如果您能逐个符号地告诉我它的作用。谢谢。
字符串应^以任何字符 ( .) 开头 ( ),后跟至少 5 ( {5,}) 个非空白字符 ( [\\S]),然后应以 ( $)结尾
^
.
{5,}
[\\S]
$
^。- 以任何字符开头(换行符除外) [\S]{5,} - 后跟 5 个或更多非空格 $ - 后跟行尾