【发布时间】:2013-05-21 20:45:38
【问题描述】:
我在搜索特殊字符“(”时遇到了一些问题。
我有一个java.util.regex.PatternSyntaxException exception has occurred。
它可能与“(”被视为特殊字符有关。
我不太擅长模式表达。有人可以帮我正确搜索转义字符吗?
// I need to split the string at the "("
String myString = "Room Temperature (C)";
String splitList[] = myString.split ("("); // i got an exception
// I tried this but got compile error
String splitList[] = myString.split ("\(");
【问题讨论】:
-
好的,非常感谢,它可以工作了。