code: protected Pattern createNonProxyPattern(String nonProxyHosts) {
          if (nonProxyHosts == null || nonProxyHosts.isEmpty()) return null;
  
          // "*.fedora-commons.org" -> ".*?\.fedora-commons\.org"
          nonProxyHosts = nonProxyHosts.replaceAll("\\.", "\\\\.").replaceAll("\\*", ".*?");
  
          // a|b|*.c -> (a)|(b)|(.*?\.c)
          nonProxyHosts = "(" + nonProxyHosts.replaceAll("\\|", ")|(") + ")";
  
          try {
              return Pattern.compile(nonProxyHosts);
  
              //we don't want to bring down the whole server by misusing the nonProxy pattern
              //therefore the error is logged and the web client moves on.
          } catch (Exception e) {
              logger.error("Creating the nonProxyHosts pattern failed for http.nonProxyHosts="
                              + nonProxyHosts, e);
              return null;
          }
      }
docs: Mimics <a href=
  "http://java.sun.com/javase/6/docs/technotes/guides/net/proxies.html">
  the java nonproxyhost syntax</a> and turns the nonproxyhost expression
  into a regex pattern. Basic idea taken from the HttpImpl class of the
  Liferay Portal software.
  
  @param nonProxyHosts
  the String that contains the http.nonProxyHosts value. If this
  value is empty or invalid, null is returned. If the value is
  valid, a pattern is retured.
  @return the Pattern or null.