I have a 2 part question (warning – I am new to Sublime and rusty on my regex syntax):
- 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:
<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 and closing highlighted. The goal is to then fold the highlighted text.
- 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
<section^>]*?>.\n]*?(</section>)
doesn’t work instead of my regex above, which seems less than elegant.