Sublime Forum

Getting the first word on a language definition

#1

When trying to define a new language that extends HTML on SublimeText, i can’t seem to find the right syntax for getting the first word on a pattern.

my goal is when this will appear:

 [something\something else else else]]

that the words “something” will have a different scope.

my pattern in the tmLanguage file is defined like so:

<key>begin</key> <string>(\\)</string> <key>end</key> <string>(\]\])</string> <key>name</key> <string>text.html.foo.fam<string>
i tried adding the following pattern without any luck:

<key>patterns</key> <array> <dict> <key>match</key> <string>(^(.*?([a-zA-Z\\]+.*?)){1})</string> <key>name</key> <string>entity.name.function</string> </dict> </array>
also posted here:
stackoverflow.com/questions/3167 … ublimetext

0 Likes