I have the following string:
<ul><li><span>some words here.</span></li><li><span>other words here.</span></li><li><span>Code: 55555.</span></li></ul>
My goal is to remove this part from the string, the set of li tags which contain "code" keyword:
<li><span>Code: 55555.</span></li>
I am trying to write a RegEx that will help me match and replace my substring.
Text in between <li></li>
might vary but it will always have the keyword "Code". This is what I have so far:
<li>(.*)code:(.*?)<\/li>
The problem is, it matches from the first <li>
tag and I want it to match starting from the <li>
tag which is right before our keyword "code".
Thank you for your help!