JS Regex to find href of several a tags

后端 未结 9 1221
野性不改
野性不改 2020-12-28 08:04

I need a regex to find the contents of the hrefs from these a tags :

9条回答
  •  误落风尘
    2020-12-28 08:50

    You can try this regex:

    /href="([^\'\"]+)/g
    

    Example at: http://regexr.com?333d1

    Update: or easier via non greedy method:

    /href="(.*?)"/g
    

提交回复
热议问题