Re: [PHP-WIN] String Replacement

2001-01-15 Thread Cynic
yep, sorry. At 15:15 15.1. 2001, Daniel Beulshausen wrote the following: -- >At 14:57 15.01.2001 +0100, Cynic wrote: >>this one is really easy: >> >>$ret = preg_replace( '/(?!boy)s/' , 'girl' , $text ) ; > > $string = "boys, boy, fort b

Re: [PHP-WIN] String Replacement

2001-01-15 Thread Daniel Beulshausen
At 14:57 15.01.2001 +0100, Cynic wrote: >this one is really easy: > >$ret = preg_replace( '/(?!boy)s/' , 'girl' , $text ) ; should be correct. daniel >At 12:34 15.1. 2001, adam wrote the following: >-- > >Toby Butzon <[EMAIL PROTECT

Re: [PHP-WIN] String Replacement

2001-01-15 Thread Cynic
this one is really easy: $ret = preg_replace( '/(?!boy)s/' , 'girl' , $text ) ; At 12:34 15.1. 2001, adam wrote the following: -- >Toby Butzon <[EMAIL PROTECTED]> said: > >> lol... >> >> Ok, so you want to replace ONLY the word "boy"

Re: [PHP-WIN] String Replacement

2001-01-15 Thread adam
Toby Butzon <[EMAIL PROTECTED]> said: > lol... > > Ok, so you want to replace ONLY the word "boy" with the word "girl"... you > don't want to touch "boys". > > Perhaps str_replace("boy ", "girl ", $myStr) would do the trick? > No, I thought of that - if the word is up against a fullstop or com

Re: [PHP-WIN] String Replacement

2001-01-14 Thread Chris Adams
On 14 Jan 2001 19:40:28 -0800, Toby Butzon <[EMAIL PROTECTED]> wrote: >Ok, so you want to replace ONLY the word "boy" with the word "girl"... you >don't want to touch "boys". > >Perhaps str_replace("boy ", "girl ", $myStr) would do the trick? Better yet, preg_replace("/\bboy\b/i", "girl", $myStr)

Re: [PHP-WIN] String Replacement

2001-01-14 Thread Toby Butzon
k" <[EMAIL PROTECTED]> To: "'Toby Butzon'" <[EMAIL PROTECTED]>; "Flint Doungchak" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Sunday, January 14, 2001 10:35 PM Subject: RE: [PHP-WIN] String Replacement > OK, > > Let's try

RE: [PHP-WIN] String Replacement

2001-01-14 Thread Flint Doungchak
lint -Original Message- From: Toby Butzon [mailto:[EMAIL PROTECTED]] Sent: Sunday, January 14, 2001 7:29 PM To: Flint Doungchak; [EMAIL PROTECTED] Subject: Re: [PHP-WIN] String Replacement Seems to me that you've got what you want... If I'm reading you right, you want to keep pl

Re: [PHP-WIN] String Replacement

2001-01-14 Thread Toby Butzon
Seems to me that you've got what you want... If I'm reading you right, you want to keep plural words plural and singular words singular... so boys would become girls and boy would become girl. Well... if you just replace boy with girl you get that result... So I'm not seeing the problem... enlig