i think this is the correct format when using RegExp and not string.match.
please take a look...hope i helped.
use the string.match regex instead of RegExp.
we get the array much more easily.
Please review it and use it if it's good.
this patch should correct the problem with the initial script that gives you only the first match.
Merge pull request #17 from snitsan/master

Use the string.match regex instead of RegExp.