$value='x-Cem-Date:Wed, 16 Dec 2009 15:42:28 GMT';
Right now I have:
$value = preg_replace('/(^.+)(?=:)/e', "strtolower('\\1')", $value);
this outputs
$value='x-cem-date:wed, 16 dec 2009 15:42:28 GMT';
it should output:
$value='x-cem-date:Wed, 16 Dec 2009 15:42:28 GMT';
Your regular expression should be as follows:
The difference is the
+?character. The+?is non-greedy, meaning that it will find the LEAST amount of characters until the expression moves onto the next match in the expression, instead of the MOST characters until the next match.