Regular Expression - Exec
Say I have a string that has something like this...
var str = "...toggleAlt('tab','text')..."
Now I know that I should be able to use regular expressions to extract it... but having issues... currently using this...
var myRe = /'(.*)'/g;
var result = myRe.exect(str)
but I only want to get the value of 'tab'... but I'm getting the value of 'tab','text'...
Any suggestions?
|