Python regular matching URL

(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]

Reference: Regular expressions that correctly match URLs - Shen Longbin's Programming Life - Blog Park

if findall,

(?:https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]

Reference: About a pitfall in using findall and grouping in regular expressions in Python_Mike Jiang's Blog-CSDN Blog

Guess you like

Origin blog.csdn.net/u011519550/article/details/125044761