Parse nested function call string in javascript
问题 I want to parse the following string (using Javascript): color(alias(sumSeries(sys.mem.free.*),"memory (free)"),"#00AA88") into an array of function names and arguments: [["color", "#00AA88"], ["alias", "memory (free)"], ["sumSeries", ""]] plus extract the innermost string sys.mem.free.* The string is actually the target parameter from graphite. I don't want to write a parser myself (dealing with things like double quotes and brackets is hard to get right). Is there a library which helps with