Ver Mensaje Individual
  #8 (permalink)  
Antiguo 15/05/2010, 20:39
Avatar de wiwi74
wiwi74
 
Fecha de Ingreso: marzo-2008
Mensajes: 515
Antigüedad: 16 años, 2 meses
Puntos: 10
Respuesta: problema de expresiones regulares?

Es cierto que esta copiaro y pegado, pero se puede recupear siendo que este en un archivo externo:

Por ahora ve esto a ver si te sive de algo:

Crea un archivo php y solo presiona el boton, luego.



<?

$texto="<section>
Modelling, Texturing and Animating a Hand
</section>

<section>
<h3>
<strong>by Julian MacDonald</strong>
</h3>
</section>

<section>
<h2>
<strong class='c3'>Adding a Texture</strong>
</h2><br />
<br />
<br />
There are a number of options available for applying a texture to the hand object. For a simplistic, cartoonish look we could go for a uniform texture and that would be technically quite
simple.<br />
<br />
<a class='c1' href='hand_skeleton.html'><span class='arrows fLeft'>Previous: Setting up the Skeleton</span></a> <a class='c1' href='hand_animation.html'><span class='arrows fRight'>Next: Animating
the Hand</span></a> <a class='c1' href='contents.html'><span class='arrows'>Back to Contents</span></a><br />
</section>";


?>
<form action="" method="post">
<input type="hidden" name="texto" value="<?=$texto?>">
<input type="submit" value="Eniar">
</form>
<?

//echo $_POST['texto'];

// $patron = '/<section>(.*?)<\/section>/is';
$patron = '/<section>((?:(?!section>).)*)<\/section>/isU';

preg_match_all($patron, $_POST['texto'], $matches, PREG_SET_ORDER);

echo count($matches);

?>
















<!--
Por aqui vi un post:
http://dgmmorales.com/blog/?p=32
-->