Does this exist?
I need to parse a string like:
the dog from the tree
and get something like
[[null, "the dog"], ["from", "the tree"]]
which I can do in Ruby with one RegExp and String#scan.
JavaScript's String#match cannot handle this as it just return what the RegExp is matched and not the capturing groups, so it returns something like
["the dog", "from the tree"]
Because I used String#scan many times in my Ruby application, it would be nice if there was a quick way to replicate this behavior in my JavaScript port.
EDIT: Here is the RegExp I'm using: http://pastebin.com/bncXtgYA