[PHP-WIN] String replacement...

2002-05-14 Thread R.S. Herhuth
I have a situation where I will be pulling back an article that may contain none or several references to link IDs in the following format: The rest of the article is basically text in the format of a news article. What I need to do is to extract the ID (the #226 in this example) and run a que

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
ing the problem... enlighten me? ;) --Toby - Original Message - From: "Flint Doungchak" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, January 14, 2001 10:24 PM Subject: [PHP-WIN] String Replacement > Hello all, > > Hope you all had a nice weekend. Simp

[PHP-WIN] String Replacement

2001-01-14 Thread Flint Doungchak
Hello all, Hope you all had a nice weekend. Simple question, I think. I would like to find all occurance of: boy or boys and replace it with: girl or girls respectively. My problem is that using the str_replace function like this: str_replace("boy","girl","$string"); turns boys into girls