code: public String getCapturedText(int index) {
  		if (this.beginpos == null)
  			throw new IllegalStateException("match() has never been called.");
  		if (index < 0 || this.nofgroups <= index)
  			throw new IllegalArgumentException(
  					"The parameter must be less than " + this.nofgroups + ": "
  							+ index);
  		String ret;
  		int begin = this.beginpos[index], end = this.endpos[index];
  		if (begin < 0 || end < 0)
  			return null;
  		if (this.ciSource != null) {
  			ret = REUtil.substring(this.ciSource, begin, end);
  		} else if (this.strSource != null) {
  			ret = this.strSource.substring(begin, end);
  		} else {
  			ret = new String(this.charSource, begin, end - begin);
  		}
  		return ret;
  	}
docs: Return an substring of the target text matched to specified regular
  expression group.
  
  @param index
  Less than <code>getNumberOfGroups()</code>.