Assume the following strings:
aaa bbb ccc
bbb aaa ccc
I want to match aaa
as long as it is not at the start of the string. I'm trying to negate it by doing something like this:
[^^]aaa
But I don't think this is right. Using preg_replace
.
You can use a look behind to make sure it is not at the beginning. (?<!^)aaa