Thanks for the explanation but Regex can’t find '#end and go up. What it does is to find ); and then go down until it finds '#end. If we don’t want xx in between we need to use (?!xx) to tell it not to match xx.
I hope it’s right this time:
\);((?!\);)[\s\S])*?'#end