You are correct: Regex support -- doesn't ST2 use the Boost library?
Oniguruma docs: geocities.jp/kosako3/oniguruma/
It’s pretty consistent with other regex engines. The only thing I’ve missed is the conditional as described in that thread.
I’ll give it a shot…
Edit: Unless I’m missing something, this is just a matter of establishing precedence:
<key>patterns</key>
<array>
<dict>
<key>name</key>
<string>entity.name.function</string>
<key>match</key>
<string>.*?(?={)</string>
</dict>
<dict>
<key>name</key>
<string>two</string>
<key>begin</key>
<string>{</string>
<key>end</key>
<string>}</string>
</dict>
<dict>
<key>name</key>
<string>comment</string>
<key>begin</key>
<string>;</string>
<key>end</key>
<string>Code</string>
</dict>
</array>
Ignore the fact that the middle example is treated as a comment from the stray semi-colon on line 5…
Edit 2: Seems I might’ve missed a detail – I think you want to include the semi-colon following the closing bracket. I’ll have another go.
Not extensively tested:
[code]patterns
name
two
begin
{
end
};
<dict>
<key>contentName</key>
<string>comment</string>
<key>begin</key>
<string>(?<=};)</string>
<key>end</key>
<string>:Code</string>
</dict>
<dict>
<key>name</key>
<string>entity.name.function</string>
<key>match</key>
<string>^{]*?(?={)</string>
</dict>
[/code]