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);
  }
}

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 ) ; } }
matches the given string against the given regex pattern .
