我将使用什么JavaScript正则表达式来发现一个字符串包含一个打开的HTML标签而不包含一个关闭的HTML标签?
|
我将使用什么JavaScript正则表达式来发现一个字符串包含一个打开的HTML标签而不包含一个关闭的HTML标签。例如如下:
var tags = [\'h1\', \'div\', \'span\']; // tag to look for
var str1 = \'lorem ipsum <h1>hello world\'; // here it is!
var str2 = \'boo foo 123 test\'; // this one doesn\'t have any
var str3 = \'<span>boo-boo</span>\'; // this has the tags but it is not the case as we only need the ones that have open tags and not close tags.
没有找到相关结果
已邀请:
2 个回复
功飘
琳娘
此表达式用于HTML标签。