I need to validate the a regex string as I get as parameter does not contain more than one capturing groups.
How can I do that with regex?
Tried counting occurrences of this
\(.*?\)
but I need to somehow add the option to not count parentheses as caputre groups:
(:?*)
Can anybody help me generate a better string?
I know that there are posts on validating regex by regex, but here I need specific validation for big query that does not support two capturing groups on regex_exreact. I don't need to validate that the regex is correct.
UPDATE:.
I tried both suggestions here:
\((?!\?).*?\)?
[^\\]?\([^?]
they almost work.
Apparently, after testing, I found out that capturing group within a capturing group is valid.
for example: ^aaa \\s?(\\([a-z]+\\))?$
is valid
Can this be done?
Thanks