Re: Delimiter must not be alphanumeric or backslash

From: Date: Sat, 05 Jul 2003 22:02:20 +0000
Subject: Re: Delimiter must not be alphanumeric or backslash
Groups: php.general 
Request: Send a blank email to php-general+get-154080@lists.php.net to get a copy of this message
At 2003-07-05 20:01 +0200, Alan D'Angelo wrote: >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 :) It is probably also a good idea to use single quotes ('/\bp\w+t\b/') so PHP won't try to interpret the '\w' and '\b' itself. Greetings, Jaap

« previous php.general (#154080) next »