Escaping dollars groovy
问题 I'm having trouble escaping double dollars from a string to be used with regex functions pattern/matcher. This is part of the String: WHERE oid_2 = $$test$$ || oid_2 = $$test2$$ and this is the closest code I've tried to get near the solution: List<String> strList = new ArrayList<String>(); Pattern pattern = Pattern.compile("\$\$.*?\$\$"); log.debug("PATTERN: "+pattern) Matcher matcher = pattern.matcher(queryText); while (matcher.find()) { strList.add(matcher.group()); } log.debug(strList)