Not. You have to call exec several times:
var re = /[0-9]/g; var input = "a1b2c3d"; var myArray; while ((myArray = re.exec(input)) != null) { var msg = "Found " + myArray[0] + ". "; print(msg); }
Change The "Mozilla Developers Network" page on exec has much more to say about this feature. This is where I got the example and modified it for your question.
Change 2 . I modified the code above so that it is not an infinite loop. :-)
source share