code: public static boolean isExternalUrl(String url) {
          return URL_PATTERN.matcher(url).matches() || SPECIAL_URL_PATTERN.matcher(url).matches();
      }
docs: Returns 'true' if the url is an 'external' url (starts with 'https?://' or is a special URL)