@PeterJones I’ll need to think about what you wrote.
However, this is why I was using this particular reqexp based on the help from reg101 tester website. (see their help explanation below).
This seemed to satisfy an If statement true/false condition. For the no part, I was matching another word to see how it worked with the intent of changing this to empty. Then my named group “COND” would be null, but in reality it just matched every word and then marked them as null in the string since there was no match - not what I was expecting either.
So if COND matched “if” show it in the functionlist and if it contained a colon before it skip it and not show it in the functionlist. Moreover, when COND is no/false that the second match of empty, this result wouldn’t be shown in the function list since its null (but I would end with alot of null matches within a line of code being parsed)…
Lookahead conditional
(?(?=…)yes|no)
If the lookahead succeeds, matches the pattern before the vertical bar. Otherwise, matches the pattern after the vertical bar. The lookaround can be negative also. Global flag breaks conditionals.
Example: Thus for true it highlights “is delicious”
/(?(?=is)(is delicious)|(disgusting))/
Candy is delicious or disgusting.
Since the functionlist displays functions, I need to ignore if and while statements and not show them in the functionlist but when they are overloaded by preceding them with :: such as ::if, which can be defined by a function that gives if a modified meaning, I need to show them in the functionlist. Same for while or any operator such as + - / * = etc.