Re: LiveJournal S2 Syntax Highlighting - Strings
- On 5/5/06, Max Cantor <maxcantor@...> wrote:
> S2 has a special type of string that isIt's just equivalent to
> delimited by three quotes, which allows you to include quotes and
> double quotes in the string, unescaped. (This is useful for
> quote-heavy stuff like HTML.) It looks like this:
> """this is a "cool string" in which quotes - "" need not be escaped"""
> Anyway, I'm trying to figure out how to fit this into my syntax
> highlighting. I guess my biggest problem is that I do not understand
> the canonical string region declaration; this one is from c.vim:
> syn region s2String start=+L\="+ skip=+\\\\\|\\"+ end=+"+
> What in the world do those pluses mean? And that queue of
> backslashes? I don't understand how those specifications follow
> pattern syntax.
... start=/L\="/ skip=/\\\\\|\\"/ end=/"/
... start=@L\="@ skip=@\\\\\|\\"@ end=@"@
... start=;L\="; skip=;\\\\\|\\"; end=;";
Any delimiter can be used in place of '/' to delimit regexp!
BTW it's also true about :s/// command; all of the following mean the same:
(except when separattor occurs inside the regexp and replacement).
Backslashes mean to handle the "\n\\\"" C notation. Maybe you don't need it,
depending of whether S2 handlesh backslas inside quoted sring
specially or not.