if all you did to change the existing to this form was removing
spaces and comments, then yes, that's almost the same regex.
That's what I did. I just wanted to see it on one line.
> Basically, the regex is this, right ?
>
> $buffer =~
> /^((?:.*?\n)?(?:[^%]|(?<!\\)(?:\\\\)*\\%)*?)(${RE_ESCAPE}(?:begin|end)\{.*)$/s
And basically, it looks for:
# detect \begin and \end (if they are not commented)
Literally ?
--
Jean-Christophe Helary @brandelune
https://mac4translators.blogspot.com
https://sr.ht/~brandelune/omegat-as-a-book/