Website URL name regular expression validator

Java Best Website URL name regular expression validator


  • public class Utility {
  • public static boolean isValidURL(String url)
  •   {
  • String urlPattern = "^http(s{0,1})://[a-zA-Z0-9_/\\-\\.]+\\.([A-Za-z/]{2,5})[a-zA-Z0-9_/\\&\\?\\=\\-\\.\\~\\%]*";
  •     if (url.matches(urlPattern))
  •       return true;
  •     else return false;
  •   }
  • }

Comments

Popular posts from this blog

Today Walkin 14th-Sept

Spring Elasticsearch Operations

Hibernate Search - Elasticsearch with JSON manipulation