"^\s*(\w+)\s*\((.*)\)"
group (1) is the name of the function
divide the group (2) with "," , you will get a list of steam.
updated
since I don't have a Windows system (.Net either), I am testing it with python. Nested function is not a problem. if we add "^ \ s *" at the beginning of the expression:
import re s="Round(floor(1300 + 0.234 - 1.765), 1)" m=re.match("^\s*(\w+)\s*\((.*)\)",s) m.group(1) Output: 'Round' m.group(2) Output: 'floor(1300 + 0.234 - 1.765), 1' you can split if you like: m.group(2).split(',')[0] Out: 'floor(1300 + 0.234 - 1.765)' m.group(2).split(',')[1] Out: ' 1'
Well, if your nesting function is like f(a(b,c(x,y)),foo, m(j,k(n,o(i,u))) ) , my code will not work.
source share