I've been looking for an answer for quite a while, and i can't find it anywhere else, so I'm posting over here. I need a regex for capturing this form of expression {{{any_Name}}}
. I'm looking towards capturing the starting 3 {{{
and the ending 3 }}}
.
I can capture the first three with the expression \{{3}/g
. But i can't figure out how to catch the last 3 }}}
Try this:
\{{3}[^{}]+}{3}
See live demo.
This matches:
\{{3}
is {{{
[^{}]+
is "one or more non-brackets"}{3}
is }}}
Note that }
does not need escaping.