Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Problema con regex_replace - Novato a los mandos!

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: Spanish
View previous topic :: View next topic  
Author Message
popo_ny
Smarty Rookie


Joined: 04 May 2009
Posts: 6

PostPosted: Mon May 04, 2009 10:45 am    Post subject: Problema con regex_replace - Novato a los mandos! Reply with quote

Hola a todos!

Antetodo, felicitar a todos los miembros que hacéis posible este foro ya que hasta ahora me había sacado de algún aprieto sin necesidad de tener que consultar o abrir un tema... Pero hoy, mis neuronas no dan para más!

Estoy intentando aplicar un estilo concreto de la siguiente manera:

Code:
$text_to_replace|regex_replace:"/\[quote\=(.*?)\](.*?)\[\/b\]/is":"<div class='classquote'>"


Pero no hace absolutamente NADA. Creo que el problema esta en mi presunción de que regex_replace operaria exactamente igual que preg_replace() pero me parece que hay algo que no termina de cuadrar en exceso.

La verdad es llevo nada y menos empleando smarty .oO(Aprox. 3 dias!) y estoy algo perdido... Por lo que os agradeceria cualquier tipo de ayuda o guia para encontrar el problema.

Gracias y saludos
Back to top
View user's profile Send private message
Davod
Smarty Rookie


Joined: 29 Sep 2009
Posts: 21

PostPosted: Wed Sep 30, 2009 11:32 pm    Post subject: Reply with quote

¿Encerrarste correctaamente la Expresión regular?
¿Qué pretendes hacer exactamente con esa Expresión regular?

Code:
"/\[quote\=(.*?)\](.*?)\[\/b\]/is"


Por favor explica con más detalles lo que quieres, revisa bien la Función preg_match() y ve más sobre Expresiones regulares... y tómate un descanzo, lo necesitas.

¿Reemplazar una Etiqueta <quote>?

Quote:
preg_replace("/(<quote>)/",'<div class="classquote">');


Referencias:
http://www.smarty.net/manual/en/language.modifier.regex.replace.php
http://cl.php.net/manual/en/function.preg-replace.php
Back to top
View user's profile Send private message
alexzgz
Smarty n00b


Joined: 03 Dec 2009
Posts: 3

PostPosted: Fri Dec 04, 2009 9:17 am    Post subject: Reply with quote

interesante.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: Spanish All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP