diff options
Diffstat (limited to 'progs/a766.py')
-rw-r--r-- | progs/a766.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/progs/a766.py b/progs/a766.py new file mode 100644 index 0000000..cd09339 --- /dev/null +++ b/progs/a766.py @@ -0,0 +1,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
\ No newline at end of file |