private Pattern makePattern ( String noProxy ) { String regex = noProxy . replaceAll ( "\\." , "\\\\." ) . replaceAll ( "\\*" , ".*" ) ; if ( ! regex . startsWith ( ".*" ) ) { regex = ".*" + regex ; } regex = "^" + regex + "$" ; return Pattern . compile ( regex ) ; }
Creates a regexp pattern equivalent to the classic noProxy wildcard expression .