Pattern – <(\w+)>.+</\1>
Input String – "Testing <tag>some <b>idiot</b> text</tag>idiot text continue.."
Now I received the result as "<tag>some <b>idiot</b> text</tag>". Is there any way I can modify the pattern, so that it will give me result something like :
"<tag>some <b>idiot</b> text</tag>"
"<b>idiot</b>"
Here’s how:
Output: