Fw: [PHP] preg_replace (underscore)

From: Date: Tue, 29 Oct 2002 15:50:52 +0000
Subject: Fw: [PHP] preg_replace (underscore)
Groups: php.general 
Request: Send a blank email to php-general+get-121884@lists.php.net to get a copy of this message
Thanks, but I'm trying to replace ALL non alpha-numeric characters, which I'm doing with the preg_replace, however it leaves the _. Seems silly to use preg_replace and then use str_replace. Thanks! Shawn "John Meyer" <johnmeyer_1978@yahoo.com> wrote in message news:<EAENLOPADLNBJJFJCEKFEEDJCCAA.johnmeyer_1978@yahoo.com>... > i've just used str_replace for underscores and it's worked > wonderfully. > > -----Original Message----- > From: Shawn McKenzie [mailto:nospam@mckenzies.net] > Sent: Monday, October 28, 2002 4:46 PM > To: php-general@lists.php.net > Subject: [PHP] preg_replace (underscore) > > > Why does preg_replace("^\W^","",$str); not remove undescores _ ? Are > they alpha-numeric? > > I had to do this preg_replace("^\W|_^","",$str); > > TIA, > Shawn > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#121884) next »