I want get a regex to filter the html. The rule is: remove all the tags from the html string except li tags (if there is content in the li).
What’s the right regex?
Source string:
<td>1</td><li>2</li><li></li>
Expected result:
1<li>2</li>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you’re going with C# the Regex looks a little like this: