var html = "111
222
333
";
condition: use js regular
to expect: an array ["111", 22", 222, 33"]
var html = "111
222
333
";
condition: use js regular
to expect: an array ["111", 22", 222, 33"]
can actually think differently (I don't know if it can meet your needs):
first render the html elements to the page, then traverse these element nodes, and
get the innerText, of the elements into an array
for example:
const ele = document.getElementsByTagName("p")
let eleArr = Array.from(ele).map(item => item.innerText)
console.log(ele, eleArr)
var html = "111
222
333
";
var reg = /<\/p>\s*/;
var result = html.slice(3,html.length - 4).split(reg);
var html = "111
222
333
";
var reg = /(?<=>)[^<>]+(?=<)/g;
console.log(html.match(reg))//["111","222","333"]
var html = "111
222
333
";
html.match(/[^><]+(?=<\/p>)/img);
var reg = / (? < =
). * (? =
) / gi;var res = testStr.match (reg);