I am a noob to regex.
I have string like:-
String str = "sbs 01.00 sip ${dreamworks.values} print ${fwVer} to
used ${lang} en given ${model} in ${region}";
and i have to extract all patterns matched with this type ${....}
Like:- for given str result should be
${dreamworks.values}
${fwVer}
${lang}
${model}
${region}
further if it finds any duplicates then gives only one . for ex:-
String feed = "sip ${dreamworks.values} print ${fwVer} to ${fwVer} used
${lang} en ${lang}given ${model} in ${region}"
result should be:-
${dreamworks.values}
${fwVer}
${lang}
${model}
${region}
only
this is my answer:-
PLACEHOLDER_PATTERN = "\\$\\{\\w+\\}";
but this one not giving the correct result. it gives only
${fwVer}
${lang}
${model}
${region}
So please suggest me correct regex.