Thank you to everyone who’s replied. My issue has been solved. For anyone else who may be interested, i report my findings below.
On Wednesday, September 15, 2021 at 3:26:11 AM UTC-7 [email protected] wrote: > You miswrote your lookahead-assertion. > Oh boy i sure did. Thank you for pointing that out. > Try this instead: > > (?s)<h2>.+?(?=<h2>|\Z) > ^ This is spectacular, and what i’ll be using. After testing it, i made myself sit down and re-read the Grep Help to understand what each part of the expression is doing. I’d entirely missed the section on the (?s) ability to allow . to include \r as well. This knowledge alone will help improve a number of my other regular expressions. I’ve not used positional assertions like \Z in the past, hence they don’t come to mind—something else learned—thanks! The PERL filters (original and Chris’ modification both tested) failed for me: created the folder on the Desktop, but it was empty. The original document did remain intact. *But that’s OK* because i‘ve not evolved to the point to be doing exactly that yet. No one should spend any more time on this PERL filter on my behalf. This is both a learning experience and practical matter of getting things done activity for me, so it’s best for me to clunk along on training wheels with Text Factories full of Replace All clauses and likely AppleScript until i’m ready to learn more and get into something like PERL. Appreciatively, ))Sonic(( -- This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "[email protected]" rather than posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit> --- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/d11dfe55-f72c-41d0-bfc6-da74def5a02en%40googlegroups.com.
