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