Code example for MatchResult

Methods: group

0
     */ 
    public String group(int matchnum) {
        if (this.result == null) {
            return null; 
        } 
        return this.result.group(matchnum);
    } 
 
    /** 
     * For debugging purposes - returns a string shows each match group by 
     * number. 
     * 
     * @return a string shows each match group by number. 
     */ 
 
    public String getGroupsAsString() {
        StringBuilder b = new StringBuilder();
        for (int i = 1; i <= this.result.groupCount(); i++) {
            b.append(i).append(") ").append(this.result.group(i)).append(
                    System.getProperty("line.separator"));
        }