Re: reg. expressions

From: Date: Wed, 13 Oct 2004 14:17:25 +0000
Subject: Re: reg. expressions
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-199374@lists.php.net to get a copy of this message
> on one place I have string "something (something_2)" > I have to take out of the string everything in brackets and brackets as > well. > probably I will need to use Regular Expression Functions but I'm really > bad with them :) $string = "something (something_2)"; $pattern = "/\(.*\)/"; $replacement = ""; echo preg_replace($pattern, $replacement, $string);

« previous php.general (#199374) next »