Regex URL Match

后端 未结 3 1340
滥情空心
滥情空心 2021-01-29 07:43

I just really started learning how to use regex\'s and i am trying to create one to match urls. So far i have:

(http://|https://|www|\\w)+\\.[\\w]{2,4}[^\\s]+
         


        
3条回答
  •  难免孤独
    2021-01-29 08:23

    Plenty of stuff on the web...

    • You can look at what we do within Horde: Horde URL filter
    • Ours has been derived from http://daringfireball.net/2010/07/improved_regex_for_matching_urls
    • And there is also PHP validation/regex for URL

提交回复
热议问题