note 77934 added to function.preg-replace

From: Date: Thu, 20 Sep 2007 13:52:15 +0000
Subject: note 77934 added to function.preg-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-130630@lists.php.net to get a copy of this message
@ Santosh Patnaik The perl regular expression engine will handle this expression better and much faster by using the word boundry escape code \b. Though it may not be obvious except to long time perl geeks such as I :) so: // Expect and get 'pa pa pa pa' echo preg_replace('\bma\b', 'pa', 'ma ma ma ma'); Jeff ---- Server IP: 64.71.164.2 Probable Submitter: 201.194.232.206 ---- Manual Page -- http://www.php.net/manual/en/function.preg-replace.php Edit -- https://master.php.net/note/edit/77934 Del: integrated -- https://master.php.net/note/delete/77934/integrated Del: useless -- https://master.php.net/note/delete/77934/useless Del: bad code -- https://master.php.net/note/delete/77934/bad+code Del: spam -- https://master.php.net/note/delete/77934/spam Del: non-english -- https://master.php.net/note/delete/77934/non-english Del: in docs -- https://master.php.net/note/delete/77934/in+docs Del: other reasons-- https://master.php.net/note/delete/77934 Reject -- https://master.php.net/note/reject/77934 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#130630) next »