0
正确的字符串我有串:查找字符串
<em>hhhhhhhhhhhhh gggggggggggg hhhhhhhhhhh</em> <strong>hhhhhhhhhh hhhhhhhhh hhhhhhhhh</strong> gggggggggg ggggggg hhhhhhhhhhh ggggggggggggggggggggggggg <em>ggggggg ggggggg <strong>gggggggg dddddddddd</strong></em>
,现在我不会找到:
var regex = /<em>(.*?)<\/strong><\/em>/g;
var spr = string.match(regexxx);
alert(spr.toString());
这将打印我满弦。
<em>hhhhhhhhhhhhh gggggggggggg hhhhhhhhhhh</em> <strong>hhhhhhhhhh hhhhhhhhh hhhhhhhhh</strong> gggggggggg ggggggg hhhhhhhhhhh ggggggggggggggggggggggggg <em>ggggggg ggggggg <strong>gggggggg dddddddddd</strong></em>
当然这很好。 但这不是我想要的! 我想这一点:
<em>ggggggg ggggggg <strong>gggggggg dddddddddd</strong></em>
正则表达式必须找到之间的一切:
<em>...</strong></em>
但如果
之间<em>..**</em>**.</strong></em> .
这是不正确的:
<em>testestest</em>test test</strong></em>
这是好:
<em>test<strong>test test</strong></em>
我用什么正则表达式来做到这一点?
[强制性](http://stackoverflow.com/a/1732454/1223693) – Doorknob