question: public static final String concatGroups ( MatcherCompat matcher ) { StringBuilder b = new StringBuilder ( ) ; final int numGroups = matcher . groupCount ( ) ; for ( int i = 1 ; i <= numGroups ; i ++ ) { String s = matcher . group ( i ) ; if ( s != null ) { b . append ( s ) ; } } return b . toString ( ) ; }
target:  Convenience method to take all of the non-null matching groups in a regex Matcher and return them as a concatenated string.