RE: [PHP] Replace in a string with regex

2009-07-22 Thread rszeus
Thank you very much! Understand. And it Works very well now. Cheers -Mensagem original- De: Ford, Mike [mailto:m.f...@leedsmet.ac.uk] Enviada: quinta-feira, 23 de Julho de 2009 00:04 Para: php-general@lists.php.net Assunto: RE: [PHP] Replace in a string with regex > -Origi

RE: [PHP] Replace in a string with regex

2009-07-22 Thread Ford, Mike
> -Original 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 strin

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Jim Lucas
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.

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 Jim Lucas
$2 and $3 ? > $ " I already knwo it's the (.+?) but the others didnt' get it. > > Thank you... > > -Mensagem original- > De: Eddie Drapkin [mailto:oorza...@gmail.com] > Enviada: quarta-feira, 22 de Julho de 2009 16:03 > Para: a...@ashleysheridan.c

RE: [PHP] Replace in a string with regex

2009-07-22 Thread rszeus
uarta-feira, 22 de Julho de 2009 17:22 Para: rszeus Cc: 'Eddie Drapkin'; a...@ashleysheridan.co.uk; 'Jim Lucas'; php-general@lists.php.net Assunto: Re: [PHP] Replace in a string with regex The first match inside () is assigned to $1, the second is assigned to $2, and so on

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Kyle Smith
ginal- 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: Hi. It Works to remove the _1 but it doesn

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 Andrew Ballard
On Wed, Jul 22, 2009 at 11:01 AM, Ashley Sheridan wrote: > On Wed, 2009-07-22 at 07:54 -0700, Jim Lucas wrote: >> Sure that can be done.  But you will need to change the second argument >> to have double quotes so it will be parsed by PHP. >> >> Then I would surround YOUR variable with curly bracke

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Eddie Drapkin
quot;$1{$id}$3", >>                   $file); >> >> > I am confusing " and '. >> > >> > Thank you >> > >> > >> > -Mensagem original- >> > De: Eddie Drapkin [mailto:oorza...@gmail.co

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Ashley Sheridan
> > > -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 > >

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Jim Lucas
"$1{$id}$3", $file); > I am confusing " and '. > > Thank you > > > -Mensagem original- > De: Eddie Drapkin [mailto:oorza...@gmail.com] > Enviada: quarta-feira, 22 de Julho de 2009 14:12 > Para: rszeus &g

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 Robert Cummings
You can disregard this, it's wrong (I missed a part of the requirements :) and there's other solutions already provided (my email client is weird when you switch to a folder it always displays the first entry as the last read, so sometimes I miss that there are new posts above... I just switche

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Robert Cummings
rszeus wrote: 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)

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 Eddie Drapkin
a: quarta-feira, 22 de Julho de 2009 13:11 > Para: rszeus > Cc: php-general@lists.php.net > Assunto: Re: [PHP] Replace in a string with regex > > On Wed, Jul 22, 2009 at 8:02 AM, rszeus wrote: >> Hello, >> >> I’m tryng to make some replacements on a string. >>

RE: [PHP] Replace in a string with regex

2009-07-22 Thread rszeus
php.net Assunto: Re: [PHP] Replace in a string with regex On Wed, Jul 22, 2009 at 8:02 AM, rszeus wrote: > Hello, > > I’m tryng to make some replacements on a string. > > Everything goês fine until the regular expression. > > > > $file = "screens/temp/7a45gfdi6icpan1

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Ashley Sheridan
On Wed, 2009-07-22 at 13:02 +0100, rszeus wrote: > 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(7a45gfdi6icpan1jtb1j99o

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Eddie Drapkin
On Wed, Jul 22, 2009 at 8:02 AM, rszeus wrote: > 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, > 't