Re: How to replace contents between two specific words

2021-09-19 Thread Tim A
Overkill is a great way to learn. Experimenting further I got my solution to fail when AAA and/or BBB was not by itself. Now I am trying to figure out what the *?s:* colon business is in your solution (?<=^AAA\n)(?s:.*?)(?=^BBB$) pg 197 of manual for version 12.6.7 These options can

Re: How to replace contents between two specific words

2021-09-19 Thread Neil Faiman
Only the OP knows exactly what the delimiter rule is — any occurrence of AAA and BBB, or as words, or as complete lines … — so the best way to code the delimiters isn’t clear, but aside from that, I agree completely. Using pre- and post-assertions to match just the string to be removed is

Re: How to replace contents between two specific words

2021-09-19 Thread Tim A
On Saturday, September 18, 2021 at 10:01:50 AM UTC-7 Neil Faiman wrote: > Use this “Find” string: (?s)(?<=\bAAA\b).*?(?=\bBBB\b) > Neil's solution encouraged me to learn about "Pattern Modifiers", e.g. (?imsx) And I am able to parse the look around aspects of his solution... but isn't it