Regex to match URL

后端 未结 14 2125
耶瑟儿~
耶瑟儿~ 2020-11-22 09:41

I am using the following regex to match a URL:

$search  = \"/([\\S]+\\.(MUSEUM|TRAVEL|AERO|ARPA|ASIA|COOP|INFO|NAME|BIZ|CAT|COM|INT|JOBS|NET|ORG|PRO|TEL|AC|A         


        
14条回答
  •  孤街浪徒
    2020-11-22 10:13

    I think this is simple and efficient /^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/

提交回复
热议问题