正则表达式核心部分:
(http|https):\/\/([\w.!@#$%^&*()_+-=])*\s*
Python的实现:
pattern = re.compile(r'(http|https):\/\/([\w.!@#$%^&*()_+-=])*\s*')
如果在URL中遇到很少见的字符,可以在[\w....]中继续添加。
正则表达式核心部分:
(http|https):\/\/([\w.!@#$%^&*()_+-=])*\s*
Python的实现:
pattern = re.compile(r'(http|https):\/\/([\w.!@#$%^&*()_+-=])*\s*')
如果在URL中遇到很少见的字符,可以在[\w....]中继续添加。