question: private static Matcher match ( String s , String pat , String name ) { try { Pattern p = Pattern . compile ( pat ) ; Matcher m = p . matcher ( s ) ; if ( ! m . matches ( ) ) { return ( null ) ; } return ( m ) ; } catch ( PatternSyntaxException e ) { log . error ( "Malformed DCC++ message syntax! s = " , pat ) ; return ( null ) ; } catch ( IllegalStateException e ) { log . error ( "Group called before match operation executed string= " + s ) ; return ( null ) ; } catch ( IndexOutOfBoundsException e ) { log . error ( "Index out of bounds string= " + s ) ; return ( null ) ; } }
target:  matches the given string against the given Regex pattern.