Preg_match_all <a

后端 未结 6 1796
天命终不由人
天命终不由人 2020-12-02 02:25
6条回答
  •  既然无缘
    2020-12-02 03:07

    Regex for parsing links is something like this:

    '/]+|"[^"]*"|'[^']*')*href=("[^"]+"|'[^']+'|[^<>\s]+)/i'
    

    Given how horrible that is, I would recommend using Simple HTML Dom for getting the links at least. You could then check links using some very basic regex on the link href.

提交回复
热议问题