Re: Delimiter must not be alphanumeric or backslash

From: Date: Sat, 05 Jul 2003 18:01:35 +0000
Subject: Re: Delimiter must not be alphanumeric or backslash
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-154068@lists.php.net to get a copy of this message
Try this: <?php $text = "pot post pat patent"; if(preg_match("/\bp\w+t\b/", $text, $array)){ print $array[0]; } ?> the pattern in preg_match() does not have correct limit :) ----- Original Message ----- From: "Gentian Hila" <gentianhila@hotmail.com> To: <php-general@lists.php.net> Sent: Saturday, July 05, 2003 7:57 PM Subject: [PHP] Delimiter must not be alphanumeric or backslash hello there, I am just learning PHP now, so i am very new to it. I was trying the following code which i received from a PHP book. I am using Version 4.3.1 installed in windows <? $text = "pot post pat patent"; if(preg_match( "\bp\w+t\b", $text, $array ) ) print $array[0]; ?> I was expecting everuthing to go normally , but i get the following error: Warning: Delimiter must not be alphanumeric or backslash in f:\apache\apache\htdocs\index.php on line 3 Does anybody have an idea what might be wrong ? Gentian Hila

« previous php.general (#154068) next »