Here you can find the source of isUrlWithUserInfo(String str)
Parameter | Description |
---|---|
str | a parameter |
public static boolean isUrlWithUserInfo(String str)
//package com.java2s; //License from project: Open Source License import java.util.regex.Pattern; public class Main { static final Pattern URL_WITH_USER_INFO_REGEX = Pattern .compile("^\\s*(((\\w+://).+@([\\w\\d\\.]+)(:[\\d]+){0,1}/*(.*))|([^\\s]+@([\\w\\d\\.]+):(.*)))"); /**/*from w w w . j a v a 2s.c o m*/ * str is url with user info * @param str * @return */ public static boolean isUrlWithUserInfo(String str) { return URL_WITH_USER_INFO_REGEX.matcher(str).matches(); } }