Re: Regex help needed...

From: Date: Mon, 12 Feb 2001 18:01:31 +0000
Subject: Re: Regex help needed...
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-39244@lists.php.net to get a copy of this message
On Mon, Feb 12, 2001 at 12:15:04PM -0500, Jesse Swensen wrote: > This should be a quick one, but I can't seem to wrap my brain around it. > All I need to do is replace leading or trailing spaces with underscores. If > there is spaces in between words, leave them alone. $fix = ereg_replace("(^ )|( $)", "_", $checkme); -- Jason Stechschulte jpstech@unoh.edu -- /* This bit of chicanery makes a unary function followed by a parenthesis into a function with one argument, highest precedence. */ -- Larry Wall in toke.c from the perl source code

« previous php.general (#39244) next »