I have a sentence like this:
Well, {hero}Superman X. 123 Sr.{/hero}, the most lovable guy was hated by {lover}Louis{/lover}.
I am using java regular exp. like this (which is not working: of course):
Pattern search = Pattern.compile("}.*{\/")
Actually it provides me this output:
}Superman X. 123 Sr.{/hero}, the most lovable guy was hated by {lover}Louis{/
When actually I want: "Superman X. 123 Sr." and then "Louis". How can this be achieved apart from running a while loop and increment the index? I can try that ..but was trying to know if there is an easier way that I am missing.