It would be great if someone could provide me the Regular expression for the following string.
Sample 1: <div>abc</div><br>
Sample 2: <div>abc</div></div></div></div></div><br>
As you can see in the samples provided above, I need to match the string no matter how many number of </div> occurs.
If there occurs any other string between </div> and <br>, say like this <div>abc</div></div></div>DEF</div></div><br> OR <div>abc</div></div></div></div></div>DEF<br>, then the Regex should not match.
Thanks in advance.
<div>and it's closing</div>? Or the whole thing? And is the<div>allowed to have attributes? Are other elements allowed to have attributes? Are you sure you want to do this by regex? it doesn't look all too elegant (better, as others suggested use a parser instead?)