Regex: match opening div?
Is there a way using regex to match an opening and closing div?
For example, you have "<div class="whatever"> that you'd like to delete, along with the closing </div>, but there are other divs before this one's closing </div> (i.e., nested divs). <div class="whatever">(*.?)</div> will find the targeted opening div, but will match the first closing </div> it finds rather than the one associated with the opening.
You could deal with this by using Diaps toolbox, but I'm curious if there's a way to do it with pure regex?
|