Re: Regex Question

From: Date: Thu, 30 Nov 2000 17:04:48 +0000
Subject: Re: Regex Question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-28079@lists.php.net to get a copy of this message
preg_replace( "/go/", "###", $str ); The "replacement" string is not delimited by "/". Also... if you want to do something like perl's "/go(.*)/don't go\1/" use preg_replace( "/go(.*)/", "don't go \\1", $str ); # Notice the double \\ ""John E Haag"" <jhaag@all4one.com> wrote in message news:200011301550.HAA27451@gull.prod.itd.earthlink.net... > I feel very stupid, since I can't figure out something THIS simple, > but can someone tell me how to replace: > > /go/###/ > > in a string using a Regex function?? > > The number signs indicate numbers, of which there might be One, > Two or Three of. (ie. 5, 25, 567) > > Thanks in advance for any help you can give. > > - John Haag > All4one Search Machine - http://all4one.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#28079) next »