gpt4 book ai didi

java - 模式匹配器

转载 作者:行者123 更新时间:2023-11-29 09:48:51 25 4
gpt4 key购买 nike

我有以下模式匹配器。

 Pattern pat = Pattern.compile("[^a-z][^,.:;]");

如何在其中包含 ] 字符本身?

最佳答案

你需要逃避它。

\\]

See this.

关于java - 模式匹配器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16037036/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com