I'm trying to tighten up a GREP query I was able to piece together.
This Find string allows me to find text within the <ex> tags and delete the tags themselves. The Change field then applies my Extract paragraph style.
(?s)(<ex> *)(.+?)( *</ex>)
What I need it to do is add a blank line above and below the extract. Can that be added to the string?
Yes, by changing to \r$2\r
BUT, is this text already a paragraph? If it is, it would be better to add space before and after as part of the style. If it's not, I'm not sure that adding the returns in the same operation isn't going to change the text from which it is extracted as well, so you might want to search first for <ex>.+?</ex> and change to \r$0\r without changing the formatting, then run what you have now to change the format on the extract.
Thanks P Spier. I added Paragraph returns in the Change to field, bracketing whatever $2 represents. As you can see I know just enough to be dangerous, lol. Worked a treat!
$2 represents whatever was found inside the second subexpression (set of Parentheses).