Look at this simple script please
$a = "test";
echo $b = preg_replace('/[^a](e)/',"<b>$1</b>",$a); // returns <b>e</b>st
I want to bold the "e" characters, when there is no "a" character before it.
Logically in $0
it must match "te"
, and in $1
- "e"
, but why it strips the first character in my example?
I can solve the task in another way, but i want to understand this behavior.
Thanks much