Answer the question
In order to leave comments, you need to log in
How to make PhpStorm not swear at escaping slashes in regular expressions?
PhpStorm complains about escaping slashes in regular expressions.
preg_match("/$_SERVER[HTTP_HOST]\/.*\//", $_SERVER['SCRIPT_FILENAME'], $result
Answer the question
In order to leave comments, you need to log in
He just says that you wrote garbage.
Who will escape the variable with preg_quote? Who will learn what double quotes mean in php, and what will be the regular expression as a result? If it's not you, then do it
preg_match("/$_SERVER[HTTP_HOST]\\/.*\\//", $_SERVER['SCRIPT_FILENAME'], $result);
I can advise you to update PhpStorm: everything is fine with me.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question