1  import re
2  str = "http://www.baidu.com/"
3  regular = re.compile(r'[a-zA-Z]+://[^\s]*[.com|.cn]')
4  re.findall(regular, str)                             
 ['http://www.baidu.com']

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-13
  • 2021-05-14
  • 2022-12-23
  • 2022-12-23
  • 2021-12-20
猜你喜欢
  • 2021-11-11
  • 2022-12-23
  • 2022-02-03
  • 2021-06-04
  • 2022-12-23
  • 2022-01-08
相关资源
相似解决方案