I have to match the word 'like'
without the word 'not'
before it. In the example below, there is a 'not'
before the word 'like'
so it shouldn't have matched it. How would I fix this?
$tempInput = "i do not like to fail";
if (preg_match("~(?!not )(like)~", $tempInput, $match)) {
print_r($match);
}
Result:
Array ( [0] => like [1] => like )
Need Result:
Null