I have a string:
s=\"123--abc,123--abc,123--abc\"
I tried using Ruby 1.9\'s new feature \"named groups\" to fetch all named group info:
Chiming in super-late, but here's a simple way of replicating String#scan but getting the matchdata instead:
matches = [] foo.scan(regex){ matches << $~ }
matches now contains the MatchData objects that correspond to scanning the string.
matches