PDA

View Full Version : [CLOSED] regular express?



hdsoso
Jan 16, 2014, 2:32 PM
i want to remove html ad in source code, may be it is easy for you , but it is hard for me , thank you.
the source code is


<div class=''>xxx</div>xxxxxxx<div class="gg200x300" style="padding: 19px; margin: 0px 22px 0px 0px; overflow: hidden; text-align: center; font-size: 0px; line-height: 0; float: left; border: 1px solid rgb(229, 229, 229); color: rgb(37, 37, 37); font-family: 宋体, sans-serif;"><iframe src="http://g.163.com/r site=netease&amp;affiliate=news&amp;cat=article&amp;type=logo3 00x250&amp;location=13" width="300" height="250" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></div>yyyyyy

i want it to return


<div class=''>xxx</div>xxxxxxxyyyyyy


i try to use the regular express


<div.*<iframe.*</iframe></div>

but only return


yyyyyy

i know it is eager mode , it matches the more as they can. but how to make it to lazy mode, let it matches the less as they can?

geoffrey.mcgill
Jan 16, 2014, 2:50 PM
This is out of scope for the type of technical support we provide.

You might want to try posting your question on StackOverflow (http://stackoverflow.com/).

hdsoso
Jan 17, 2014, 2:40 AM
<div[^>]+><iframe[^>]+></iframe></div>
for note