【发布时间】:2009-04-22 11:49:14
【问题描述】:
我从数组列表中得到一个字符串:
array.get(0).toString()
给出 TITLE = "blabla"
我想要字符串 blabla,所以我试试这个:
Pattern p = Pattern.compile("(\".*\")");
Matcher m = p.matcher(array.get(0).toString());
System.out.println("Title : " + m.group(0));
不起作用:java.lang.IllegalStateException: No match found
我也试试:
Pattern p = Pattern.compile("\".*\"");
Pattern p = Pattern.compile("\".*\"");
Pattern p = Pattern.compile("\\\".*\\\"");
我的程序中没有任何匹配项,但所有模式都适用于 http://www.fileformat.info/tool/regex.htm
有什么想法吗?提前致谢。
【问题讨论】: