Have statement like [[+pagetitle]] and [[++site_name]], needed separate and find each individually.
I expecting to get [[+pagetitle]] and [[++site_name]] separately with 2 different of course regexp.
Tried:
\[{2}\+{1}.*?\]{2}
\[{2}\+{1}.+\]{2}
What i currently achieved, is collecting everything. \[{2}\+{1}.*?\]{2} with capture same as + and ++ as the same, but they have different ideas behind, how to find each separate? Regex101 page https://regex101.com/r/uezzxc/1
I expecting to get [[+pagetitle]] and [[++site_name]] separately with 2 different of course regexp
>Solution :
Using \[{2}\+[^+]*?\]{2} you can match [[+pagetitle]] and not [[++site_name]] because [^+] matches anything but a + sign.
To match [[++site_name]] and not [[+pagetitle]] you could use \[{2}\+{2}.*?\]{2}.
https://regex101.com/r/acgtj6/1