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
[^^]aaa
But I don't think this is right. Using preg_replace.
preg_replace
You can use a look behind to make sure it is not at the beginning. (?<!^)aaa
(?<!^)aaa
2.1m questions
2.1m answers
60 comments
56.9k users