这是字符串
abcd&fq=-(( +ExpirationDate:[* TO *] -ExpirationDate:[2016-12-13T08:00:00Z TO *]))&fq=-SupplierId:\"systemid:1000008557\"&fq=-Id:\"systemid:1000009073\"&rows=20&arches.preview=false&sort=score desc,DefaultRelevance desc&bmf=50&wt=text";
想获得以下作为输出
fq=-(( +ExpirationDate:[* TO *] -ExpirationDate:[2016-12-13T08:00:00Z TO *]))
fq=-Id:\"systemid:1000008557\"&fq=-Id:\"systemid:1000009073\"
尝试如下
String regex = "fq=.*&";
Pattern p = Pattern.compile(regex);
matcher = p.matcher(str);
while (matcher.find()) {
System.out.println(matcher.group());
}
但输出为
fq=-SupplierId:\"systemid:1000008557\"&fq=-Id:\"systemid:1000009073\"&rows=20&arches.preview=false&sort=score desc,DefaultRelevance desc&bmf=50&