Regex to match URL

后端 未结 14 2153
耶瑟儿~
耶瑟儿~ 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条回答
  •  旧时难觅i
    2020-11-22 09:49

    $ : The dollar signifies the end of the string.
    For example \d*$ will match strings which end with a digit. So you need to add the $!

提交回复
热议问题