This RegEx finds the images and the captions. I want to remove the empty lines above and below them.
When I add \n before and after the Capturing group, Scrivener won’t find them any more. When I enter them using Ctrl+Enter as the Tooltip suggest… Scrivener won’t find them any more either.
I’ve tried the multiline mode (?m) , the global mode (?g) and the single line mode (?s) before the RegEx without success.
Does anybody knows how to do this on a Windows machine?
It is detecting the text that’s replaced with images. As you can see in the image by the yellow background of that text.
So how do I remove all empty lines?
Images are not text, so I don’t see how that does anything about empty lines around embedded images. If they were not embedded and instead you used placeholder tags such as <$img:image name>, you can work up a RegEx to match that. In that case jpg, jpeg, or png is not part of the name, so you’d key on $img itself.
Removing empty lines is simple, just replace ¶¶ with ¶ in Edit/Replace or Project Replace.
The pattern (mine) worked in search but not in Find. I do think that’s a bug.
Replacement worked in Compile – but I didn’t try returning the captures (if I captured them at all).
Well, I got it to find the text with the Returns around it.
I even got it to replace the found text with something.
Unfortunately, the only text it will replace it with is “$1”, literally.
Not the content of the Capturing Group $1.