RE: [PHP] Replace in a string with regex

2009-07-22 Thread rszeus
nal Message- > From: rszeus [mailto:rsz...@gmail.com] > Sent: 22 July 2009 19:23 > To: 'Jim Lucas' > Cc: 'Kyle Smith'; 'Eddie Drapkin'; a...@ashleysheridan.co.uk; php- > gene...@lists.php.net > Subject: RE: [PHP] Replace in a string with regex > >

RE: [PHP] Replace in a string with regex

2009-07-22 Thread rszeus
l- De: Jim Lucas [mailto:li...@cmsws.com] Enviada: quarta-feira, 22 de Julho de 2009 18:44 Para: rszeus Cc: 'Kyle Smith'; 'Eddie Drapkin'; a...@ashleysheridan.co.uk; php-general@lists.php.net Assunto: Re: [PHP] Replace in a string with regex rszeus wrote: > Thank you. I unde

RE: [PHP] Replace in a string with regex

2009-07-22 Thread rszeus
)_1(.+?\.jpg)#', '$1'.$id, $file); I get 0 $id = 'test'; echo preg_replace('#(screen/)temp/(.+?)_1(.+?\.jpg)#', '$1'.$id, $file); I get screen/test Any ideas ? Thank you De: Kyle Smith [mailto:kyle.sm...@inforonics.com] Enviada: q

RE: [PHP] Replace in a string with regex

2009-07-22 Thread rszeus
... -Mensagem original- De: Eddie Drapkin [mailto:oorza...@gmail.com] Enviada: quarta-feira, 22 de Julho de 2009 16:03 Para: a...@ashleysheridan.co.uk Cc: Jim Lucas; rszeus; php-general@lists.php.net Assunto: Re: [PHP] Replace in a string with regex On Wed, Jul 22, 2009 at 11:01 AM, Ashle

RE: [PHP] Replace in a string with regex

2009-07-22 Thread rszeus
27;. Thank you -Mensagem original- De: Eddie Drapkin [mailto:oorza...@gmail.com] Enviada: quarta-feira, 22 de Julho de 2009 14:12 Para: rszeus Cc: php-general@lists.php.net Assunto: Re: [PHP] Replace in a string with regex On Wed, Jul 22, 2009 at 9:07 AM, rszeus wrote: >

RE: [PHP] Replace in a string with regex

2009-07-22 Thread rszeus
leysheridan.co.uk] Enviada: quarta-feira, 22 de Julho de 2009 13:20 Para: rszeus Cc: php-general@lists.php.net Assunto: Re: [PHP] Replace in a string with regex On Wed, 2009-07-22 at 13:02 +0100, rszeus wrote: > Hello, > > I’m tryng to make some replacements on a string. > > Ever

RE: [PHP] Replace in a string with regex

2009-07-22 Thread rszeus
Hi. It Works to remove the _1 but it doesn't replace '7a45gfdi6icpan1jtb1j99o925' for 'test' Thank you -Mensagem original- De: Eddie Drapkin [mailto:oorza...@gmail.com] Enviada: quarta-feira, 22 de Julho de 2009 13:11 Para: rszeus Cc: php-general@lists.

[PHP] Replace in a string with regex

2009-07-22 Thread rszeus
Hello, I’m tryng to make some replacements on a string. Everything goês fine until the regular expression. $file = "screens/temp/7a45gfdi6icpan1jtb1j99o925_1_main.jpg"; echo $a = str_replace(array(7a45gfdi6icpan1jtb1j99o925, 'temp/',’_([0-9])’), array(“test”,"",””), $file) The idea is t