PHP Regex markdown from string

前端 未结 1 351
自闭症患者
自闭症患者 2020-12-12 02:48

I have this string: \"Download it from [http://wordpress.org/extend/plugins/wordpress-mobile-admin/](http://wordpress.org/extend/plugins/wordpress-mobile-admin/)

相关标签:
1条回答
  • 2020-12-12 03:08

    You need to escape the [, ], ( and ) as they are all regex meta-characters:

    preg_match_all('/\[(.*?)\]\((.*?)\)/', $data[$toProcess], $links);
    
    0 讨论(0)
提交回复
热议问题