Home Download Buy Blog Forum Support

PHP - MySQL syntax highlight problem

PHP - MySQL syntax highlight problem

Postby ondratra on Sun Dec 16, 2012 10:33 pm

Hello,
I got a problem with syntax higlight i hope you will help me with. I like to start my MySQL code inside PHP files on newline like a guy in this thread:
http://superuser.com/questions/355766/h ... -php-strin

Highlight ok in this example:
$query = "SELECT data
FROM table
WHERE param = 1
";

but no higlight in this example:
$query = "
SELECT data
FROM table
WHERE param = 1
";

so i searched the Packages / PHP / PHP.tmLanguage for a MySql string regexp.
On line 2061 i found this: <string>'\s*(?=(SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER)\b)</string>
which should match the case. Unfortunately i wasn't able to figure out where is the problem.

Can some some experienced user help with this please?
ondratra
 
Posts: 1
Joined: Sun Dec 16, 2012 10:22 pm

Re: PHP - MySQL syntax highlight problem

Postby macnewbold on Fri Jun 07, 2013 8:23 pm

I have the exact same issue.

I've been trying to figure out whether or not \s* in the regular expression includes newline characters, or whether the regular expressions are being evaluated as multi-line regex, but haven't been able to get to the bottom of it. Every regex tester I've tried matches the string across multiple lines with \s* matching newlines as well as other whitespace. But ST2 definitely isn't matching it.

These users are also trying to find an answer:
http://sublimetext.userecho.com/topic/115869-multistring-sql/
http://sublimetext.userecho.com/topic/121497-sql-syntax-highlighting-error-in-concatenated-python-strings/
http://sublimetext.userecho.com/topic/150963-sql-nested-in-a-python-string-is-not-highlighted-if-theres-a-newline-at-the-start-of-the-string/
macnewbold
 
Posts: 1
Joined: Fri Jun 07, 2013 8:21 pm


Return to Technical Support

Who is online

Users browsing this forum: karbica, Yahoo [Bot] and 45 guests