我遇到了一种HTML邮件格式,"<![if !supportLists]>" and "<![endif]>"
标记之间存在一些文字。我想使用正则表达式提取这些标记之间的文本。这是一个示例文本格式
输入:
"<![if !supportLists]><span style='mso-list:Ignore'>Index<span style='font:7.0pt "Times New Roman"'> Value </span></span><![endif]>"
预期输出:"Index Value "
答案 0 :(得分:0)
不要像@Justinas那样使用正则表达式,在你的情况下,你可以尝试使用像jQuery这样的api:
str = '<![if !supportLists]><span style="mso-list:Ignore">Index<span style="font:7.0pt Times New Roman"> Value </span></span><![endif]>'
$(str).text();