How does js use regular to clear the style of a table, leaving only the contents?

Aug.04,2021

should not clear the format, but convert it to html display. It must be ugly when you display text now


Please post a copy of your data. Let me see
and what you said is to keep only the content. To what extent is this retained?

for example: < td style= "xxx" > 1 > < / td >
do you want to keep tags or only 1?

try the following code:

var str = '<td style="font-size:12px;" height=18 span=2 face=>123</td>';
str.replace(/\s*[a-z]+=[^\s>]+/ig,'')

cheerio


to be clear alone, style, can try the following:

</TABLE>'.replace( reg , '');
Menu