Hello guys!
I have a string with a function call, and I want to extract the parameters from this.Lets imagine the following example:
var functionCall = "DOMUtils.setBackgroundColor(this,'#c00');";
var regExtractRegEx = /([\w\.]+)\(([A-z0-9]*)[,]{0,}/g;
var matches = new Array();
var curMatch = null;
while( (curMatch = regExtractRegEx .exec(functionCall )) != null){
matches.push(curMatch);
}
console.dir(matches);
the above code returns me the following array:
[ "DOMUtils.setRowBackgroundColor(this,"#c00"",
"DOMUtils.setRowBackgroundColor",
""#c00""
]
but I was expecting something like:
[ "DOMUtils.setRowBackgroundColor(this,"#c00"",
"DOMUtils.setRowBackgroundColor",
"this",
""#c00""
]
Can you please help me?
Tnks!
Diogo Jacobs