I'm trying to match any strings that doesn't start with "false1" or "false2", and ends with true, but the regex isn't matching for some reason. What am I doing wrong?
$text = "start true";
$regex = "~(?:(^false1|false2).+?) true~";
if (preg_match($regex, $text, $match)) {
echo "true";
}
Expected Result:
true
Actual Result:
null
^(?<!false1|false2)(.*?)true$)