JavaScript RegEx for div tags

后端 未结 10 1123
旧巷少年郎
旧巷少年郎 2020-12-17 00:26

I have a JavaScript variable which holds an HTML page and due to the setup I need to extract everything between

and
10条回答
  •  执笔经年
    2020-12-17 01:12

    var html = "
    hello stackoverflow!
    "; var matches = html.match(/[\S\s]*?<\/div>/gi); var matches = matches[0].replace(/(<\/?[^>]+>)/gi, ''); // Strip HTML tags? alert(matches);

提交回复
热议问题