Grabbing the href attribute of an A element

前端 未结 10 2407
悲&欢浪女
悲&欢浪女 2020-11-21 05:06

Trying to find the links on a page.

my regex is:

/]*href=(\\\"\\\'??)([^\\\"\\\' >]*?)[^>]*>(.*)<\\/a>/
10条回答
  •  我寻月下人不归
    2020-11-21 05:55

    I'm not sure what you're trying to do here, but if you're trying to validate the link then look at PHP's filter_var()

    If you really need to use a regular expression then check out this tool, it may help: http://regex.larsolavtorvik.com/

提交回复
热议问题