It's a bit hard to explain what I really want (better title suggestions are appreciated so people can find this easily in the future).
Suppose I have this:
{
{
$myTagThing$
}
}
I want to match
{
$myTagThing$
}
i.e. match everything from the last { before $myTagThing$ until the first } after $myTagThing$.
So I thought I'd need this \{.*\$myTagThing\$.*\}, but it will also match the first { and last } in the string (i.e. the whole example). Then I tried using a lookahead and a lookbehind (both negative) \{(.*(?!\{))\$myTagThing\$.*(?<!\})\}(https://regex101.com/r/RfdHUH/1/). But this still doesn't work.
My theory is that I might be using lookahead and lookbehind the wrong way since this is the first time I use them.
Any ideas?
EDIT: flags are \gms.