Here is my data :
'%%case.r_object_id%%' and application_phase = '%%case.status%%' and rp.quality = '%%case.<reno_application_person>.<child>.quality%%
I want to get all the objects enclosed in double percent %%
, we have 3.
Based on my implementation, matcher.find() finds the first %%
and the last %%
in the string. So its just one loop. How can i adjust my regex or code to ensure i get 3 matches ?
Matcher matcher = Pattern.compile("(%%[^\"\n]+%%)").matcher(results);
while (matcher.find()) {
try {
matcher.appendReplacement(stringbuffer, getReplacementStringValue(matcher.group().replaceAll("%", "")));
} catch (DocumentGeneratorException e1) {
e1.printStackTrace();
}
}