PHP 4.0 Bug #7257 Updated: RegEx kills String

From: Date: Mon, 23 Oct 2000 09:21:12 +0000
Subject: PHP 4.0 Bug #7257 Updated: RegEx kills String
Groups: php.dev 
Request: Send a blank email to php-dev+get-35853@lists.php.net to get a copy of this message
ID: 7257 Updated by: stas Reported By: hoglabogla@hotmail.com Status: Closed Bug Type: *Regular Expressions Assigned To: Comments: Your regexp is wrong - it is passed to Perl as /\/, which is lacking the ending /. Since regexp is bad, NULL is returned, and that's what you get in $mask. Previous Comments: --------------------------------------------------------------------------- [2000-10-16 15:31:12] hoglabogla@hotmail.com Ooops! The other way round, of course: if( $mask ) echo "OK"; else echo "Empty? Hu? PHP-Bug?"; --------------------------------------------------------------------------- [2000-10-16 15:29:40] hoglabogla@hotmail.com $mask= "anything"; $mask= preg_replace("/\/", "/a/", $mask); if( $mask ) echo "Empty? Hu? PHP-Bug?"; else echo "OK"; The preg_replace kills $mask, witch it shouldn't, i guess --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=7257

« previous php.dev (#35853) next »