Closed yogurt-island-331 closed 9 years ago
It is not possible to capture text beyond the closing newline (\n
) of a line. I assume this is because the regular expression match is only applied to that part of the text, optionally starting from a newline, spanning the line's text and then optionally ending with a newline.
What you can do can be achieved by splitting these matches individually (one for select, one for from and one for limit) or with the new .sublime-syntax
format that has been added to the dev builds recently: http://www.sublimetext.com/docs/3/syntax.html
Thanks! How can I use the new .sublime-syntax? On the doc it says "Regexes are only ever run against a single line of text at a time."
Out of curiosity, is it possible to use the begin and end capture to do multiple lines?
Yes, begin-end-matches match independently of line, but this will only work for the content. The begin and end patterns themselves are only matched against one line.
I see...thank you so much! Do you know where I can find more info on how to write my own code for
.sublime-syntax
files?
No, http://www.sublimetext.com/docs/3/syntax.html is the only resource available currently. You should look at the examples if you haven't already.
Hi there, first thanks for creating this tool, it's super useful. I am trying to write a syntax package for myself, here is the tmLanguage file: https://gist.github.com/a01379aa77c176df409b.git, but for some reason, I can't do highlighting on multiple lines. I am having issue with the section has the comment "kz part on select * from xxx"
If you use this package on this line: SELECT * FROM all_KZ LIMIT 10;
You will see that the table name after "FROM" is not highlighted as I wanted as "entity.name.function.pgsql," is this an issue for the package or am I doing something wrong? I tried to use "\n","\r\n" to replace "\s", but still didn't work...then I tried to change:
to
so that I can use "." to represent new line symbol, but then Sublime keep saying there is an error and won't let me do it...
Thank you so much!