I have an regex and i need to extract data from document.body.outerHTML
i tried various methods like .search()
, .match()
& .exec()
but it didn't work i need to extract data from whole document.body.outerHTML
. My class is as below.
class executionPrompt {
constructor(){
this.regex = /(B[0-9]{2})/
this.data = [];
}
start(){
var html = jQuery(document.body.outerHTML);
var matches = jQuery(html).html();
console.log(matches.match(this.regex));
}
}
i have whole document and regex but i am not able to get array for my matching string. Please help me.