public static Matcher getMatcher ( String pattern , CharSequence input ) { if ( pattern == null ) { throw new IllegalArgumentException ( "String 'pattern' must not be null" ) ; } input = new InterruptibleCharSequence ( input ) ; final Map < String , Matcher > matchers = TL_MATCHER_MAP . get ( ) ; Matcher m = ( Matcher ) matchers . get ( pattern ) ; if ( m == null ) { m = PATTERNS . getUnchecked ( pattern ) . matcher ( input ) ; } else { matchers . put ( pattern , null ) ; m . reset ( input ) ; } return m ; }
Get a matcher object for a precompiled regex pattern .