1) Is there a way to construct a search that selects only the text between an opening and closing tag? For example, I can use this regular expression:
- Code: Select all
<section[^>]*?>(.*|\n*)*?(</section>)
to select everything including the tags, but I want to end up with only the text (which will be other sets of tags) between the opening <section> and closing </section> highlighted. The goal is to then fold the highlighted text.
2) It seems like I should be able to do this more efficiently using RegReplace package, but my head is spinning trying to understand the terminology and which type of definition and parameters I would need to use to set this up. If anyone is willing to help me through that, or at least provide rough steps, I'd be very appreciative.
--JV
Bonus question: Can anyone explain why
- Code: Select all
<section[^>]*?>[.\n]*?(</section>)
doesn't work instead of my regex above, which seems less than elegant.