Regex strings that end with the '$' anchor break syntax highlighting for the remainder of the document. My guess is that this is clashing with rules for variables in double quotes.
Here's the code in my example:
<?php
// Highlighting before bug:
function noBug() {
$regex = "/.*abc/";
$foo = "foo";
$bar = "bar";
}
noBug();
// Highlighting including bug
function withBug() {
$regex = "/.*abc$/";
$foo = "foo";
$bar = "bar";
}
$doesItPersistPastThatFunction = "Yes, it does.";
withBug();
function evenIntoAnotherFunction() {
return "Sure does.";
}
$wouldAnotherValidRegexFixItIt = "/^sadly, no/";
withBug();
Regex strings that end with the '$' anchor break syntax highlighting for the remainder of the document. My guess is that this is clashing with rules for variables in double quotes.
Here's the code in my example: