August 10th, 2009, 04:22 PM
Simple regex question
Please look @ the following
$value = array("/-/","/between/","/and/");
$wc = trim(preg_replace($value, substr($value,1,-1), $wc));
lets say $wc is initialized with
computers between 1000 and 2000
it gets changed to
computer - 1000 - 2000
that is perfect.
now lets say wc is
how can i get preg_replace to not replace 'and' in the
second phrase yet keep the functionality of replacing 'and' in the first phrase?
August 10th, 2009, 04:33 PM
The \b metacharacter matches a word boundary...
Comments on this post