Python验证Url地址的正则表达式,python正则表达式,Python验证Url地
Python验证Url地址的正则表达式,python正则表达式,Python验证Url地
Python验证Url地址的正则表达式
如下是django中做url验证的正则表达式:
regex = re.compile( r'^(?:http|ftp)s?://' # http:// or https:// r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|' #domain... r'localhost|' #localhost... r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' # ...or ip r'(?::\d+)?' # optional port r'(?:/?|[/?]\S+)$', re.IGNORECASE)
相关内容
- Python连接mysql OperationalError: (1366, "Incorrect string
- Python使用easy_install升级包,pythoneasy_install,easy_install
- Python实现java或者.net的getHashCode()函数,pythongethashcode,
- Python正则表达式入门,python正则表达式,一. 编译正则表
- Python使用elaphe包生成二维码,pythonelaphe,首先需要安装
- Python正则表达式前向否定断言使用示例,python正则表达
- python itertools模块学习笔记,pythonitertools,python itert
- Decorate an output stream with print-like methods,decorateprint-lik
- Python合并两个字典,python合并字典,Python合并两个字典
- python生成文件目录树代码,python生成树代码,code:import
评论关闭