let htmlStr = fs.readFileSync(__dirname + '/data.xml', 'utf8')
htmlStr = htmlStr
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"')
.replace(/\n/g, '')
let itemArr = []
htmlStr.replace(/<item(([\s\S])*?)<\/item>/g, (word) => {
console.log(word)
itemArr.push(word)
return word
})
js正则表达式匹配闭合标签
最新推荐文章于 2024-06-19 16:43:49 发布