Re: Search a string between <foo></foo>

From: Date: Wed, 09 May 2001 16:46:35 +0000
Subject: Re: Search a string between <foo></foo>
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-52142@lists.php.net to get a copy of this message
On Wednesday 09 May 2001 16:14, Luiz Vitor wrote: > It's still not working. > I'm using the pattern ([^<foo>]*) and I'm getting the first match > correct, but it's not getting all the other matches. [^<foo>] means "any character except '<', 'f', 'o' and '>'" You're looking for something like this: $Text = preg_replace ('/<(foo)>(.*?)<\/\\1>/', '$2', $Text); -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) REALITY.SYS corrupted ... reboot Universe [Y,n]?

« previous php.general (#52142) next »