JavaScript RegEx for div tags

后端 未结 10 1156
旧巷少年郎
旧巷少年郎 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

    This should do it:

    pattern = /
    (.*?)<\/div>/; matches = your_html_var.match(pattern); the_string = matches[0]; document.write(the_string);

提交回复
热议问题