Javascript String superMatch(regex, callback)
String.prototype.superMatch = function(regex, callback) { var output = regex.exec(this); if(output instanceof Array) { callback.apply(output.shift(), output); }/*w ww.ja va 2 s .com*/ };