public String getText ( final String toTest , final int group ) { Matcher m = pattern . matcher ( toTest ) ; StringBuilder result = new StringBuilder ( ) ; while ( m . find ( ) ) { result . append ( m . group ( group ) ) ; } return result . toString ( ) ; }
Extract exact group from string