0

I need to remove a whole with preg_replace . Unfortunately i can't any PHP Dom facilities here as its part of a script that has not been coded by me

<div class="box" id="idxFeach" style="">
<h2 class="gr"><div hint="Refresh" onclick="xEvent.frameLoad('#popularBox','/viewFrame.php?'+Math.random()); return false;" class="icon iconRefresh"></div>Featured</h2>
<div class="boxC">
<iframe frameborder="no" align="middle" scrolling="no" src="/viewFrame.php?1381845110781" allowtransparency="true" marginheight="0" marginwidth="0" id="popularBox"></iframe>
<div class="loader" style="display: none;"></div>
</div>
</div>

I need to remove whole

<div class="box" id="idxFeach" style=""> .. </div>

Thanks a ton

user2650277
  • 6,289
  • 17
  • 63
  • 132
  • `Unfortunately i can't any PHP Dom facilities` … then `goto learn_DOM;`. `preg_replace()` is the wrong tool for it. always. – bwoebi Oct 15 '13 at 13:56
  • ***Why*** can't you use the PHP Dom features? They're built into the langage, so there's nothing to stop you using them. And as others have said already, regex is the wrong tool for this task. Maybe you should show the PHP code that you already have. We might be able to help you better if we know what you're working with. – Spudley Oct 15 '13 at 14:13
  • i didn't learn Dom yet and i am short of time...fixing it for a friend , i am just designing a plugin for glype proxy script – user2650277 Oct 15 '13 at 14:51

1 Answers1

1

preg_replace uses a regular expression engine which generates a finite automaton, so it's impossible to do a search for general nested expressions. More here:

Can regular expressions be used to match nested patterns?

Community
  • 1
  • 1
Ed E
  • 11
  • 1
  • it is finite here , see the div class above , there are no other similar div on page ...i am guessing a count with preg replace will do – user2650277 Oct 15 '13 at 14:14