I have 2 strings as below:
test1 = "<div>/*abc*/</div>";
test2 = "<div>/*abc*/Contents/*efg*/</div>";
I need to eliminate all /*...*/, div will remove if the div contains only /*...*/.
The following is regex i did:
Regex rx1 = new Regex(@"<div>/\*[^>]+\*/(</div>|<br/></div>|<br></div>)");
TemplateEditorFormatted = rx1.Replace(TemplateEditorFormatted, match => { return String.Empty; });
for string test1, it return correct result, which remove all.
But for test2, it also remove all contents. estimated result should not remove anything.
UPDATED (For learning)
for test 2, if i want to eliminate /../ but not whole div. how the regex look like?
Can anybody help? Thanks