blob: cd09339f4e0bca21668cd2cb6b6e60040c3d795d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
import re
def is_valid_URL(str):
regex = ("((http|https)://)(www.)?" +
"[a-zA-Z0-9@:%._\\+~#?&//=]" +
"{2,256}\\.[a-z]" +
"{2,6}\\b([-a-zA-Z0-9@:%" +
"._\\+~#?&//=]*)")
p = re.compile(regex)
if (str == None):
return False
if(re.search(p, str)):
return True
else:
return False
|