root/PloneSMSCommunicator/trunk/Utils.py

Revision 12 (checked in by fenix, 3 years ago)

PloneSMSCommunicator import

Line 
1 import re
2
3 def isUrl(url):
4     return re.match(r'(ht|f)tps?://[^\s\r\n]+', url)
5
6 def getHostName(server_url):
7     host_name = re.search(r'(?<=://)[a-zA-Z0-9.]+', server_url)
8     host_name = host_name.group(0)
9     return host_name
Note: See TracBrowser for help on using the browser.