/**
 * @author charles
 */




Object.extend(RegExp.prototype, {
  /**
   * Returns all under-chain corresponding to the current regular expression. .
   * @name RegExp.exec2()
   * @return {Array} Returns all under-chain corresponding to the current regular expression.
   * @extends {RegExp}
   */
    exec2: function(string) {
	      var result = new Array();
	    var hasExec = true;

	    while (hasExec){
	      var valueVar = this.exec(string);
	      if (valueVar){
	        result.push(valueVar);

	        string.replace(valueVar,"");
	      }else{
	        hasExec = false;
	      }
	    }
	    return result;
    }
});

