Answer the question
In order to leave comments, you need to log in
Why is Sublime not friendly with regex?
Sublime will syntactically highlight the parenthesis as an error in this code, why and how to get rid of it?
$new_var= preg_replace(/href="\/uploads/, '123', $var);
var emailFilter = /^[_/a-zA-Z0-9]+([!"#$%&()*+,./:;/]) ;
Answer the question
In order to leave comments, you need to log in
Have you tried running this code? You have a syntax error, so the sublime swears. preg_replace takes as its first argument a string or an array of strings, and if it is a string, then it must be enclosed in single or double quotes.
$new_var= preg_replace('/href="\/uploads/', '123', $var);
Lights up correctly. preg_replace must have a string as its first argument. Therefore, the second spelling is syntactically correct. Actually, I have it (ubuntu 12.04, Sublime 2.0.2) is shown correctly.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question