I am surprised to not easily find a similar question with an answer on SO. I would like to match everything in some functions. The idea is to remove the functions which are useless.
foo(some (content)) --> some (content)
So I am trying to match everything in the function call which can include parenthesis. Here is my PCRE regex:
(?<name>\w+)\s*\(\K
(?<e>
[^()]+
|
[^()]*
\((?&e)\)
[^()]*
)*
(?=\))
https://regex101.com/r/gfMAIM/1
Unfortunately it doesn't work and I don't really understand why.