med yousfi wrote:the regular expression must be generic and accept the fact that a parameter of a function can be a function for exemple Sum(a1,Average(a2,a3,abs(a4))) a complex expression in this case Average(a2,a3,abs(a4)) is a parameter of Sum and abs(a4) is a parameter of the the function Average...
All of the examples you have given can be matched with
.*
That matches zero or more characters. But it probably isn't what you want.
I think you are putting the cart before the horse. You have decided to use regexes, and are asking how to force them to do what you want. That's like saying "I have a hammer - how do I use it to drill a 1/4" hole in a wall?"
sure, you MIGHT be able to do it if you really work at it, but it is not the right tool.
Instead,
you should look at what you are trying to do, and then figure out what the right tool to do that is.