Java Regex URL Validate IsUrl(String str)

Here you can find the source of IsUrl(String str)

Description

Is Url

License

BSD License

Declaration

public static boolean IsUrl(String str) 

Method Source Code

//package com.java2s;
//License from project: BSD License 

import java.util.regex.*;

public class Main {
    public static boolean IsUrl(String str) {
        Pattern pattern = Pattern.compile("^[\\w]+://[\\w\\-\\.]+");
        Matcher matcher = pattern.matcher(str);
        if (matcher.find()) {
            return true;
        }/*from   ww  w  .  j a  va 2  s .c om*/
        return false;
    }
}

Related

  1. isUrl(final String url)
  2. isUrl(String aUrl)
  3. isURL(String f)
  4. isUrl(String s)
  5. isUrl(String s)
  6. isUrl(String test)
  7. isUrl(String text)
  8. isURL(String url)
  9. isUrl(String url)