I want to replace all the %(<>). String can be nested pattern as well.
para %(test) pattern %(te%(value)st) Hello Testing
I want it to be converted to
para MATCHFOUND pattern MATCHFOUND Hello Testing
Using the below regex
\%\((.*?)\)+
I get:
**para MATCHFOUND pattern MATCHFOUND*st)* Hello Testing**
Which is not correct as st)
is not treated in pattern
Can anyone help me out with a proper regex to handle this.