I want to add my own syntax (language) to Sublime Text 2. I already know how to include it to the syntax list so my only problem now is the syntax highlighting. But first I want to understand the Oniguruma language used for matching the words I want to highlight so I can make things on my own.
Here's my code
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>xmp</string>
</array>
<key>name</key>
<string>XMP</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>??????????????????????????????????????????????</string>
<key>name</key>
<string>source.keyword.xmp</string>
</dict>
</array>
<key>scopeName</key>
<string>source.xmp</string>
<key>uuid</key>
<string>750d3b02-a1bc-4b09-a794-1b78c54a4e21</string>
</dict>
</plist>
And just like the other programming languages (e.g HTML or XML), instead of using <>
(in HTML) I'll use []
and also the /
for closing the statement. So basically I'll just replace those <>
to []
but how can I translate it to Oniguruma (regex)?
Here's what I want it to be
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>[SIZE=""][/SIZE]</string>
<key>name</key>
<string>code.size.xmp</string>
</dict>
<dict>
<key>match</key>
<string>[BOLD][/BOLD]</string>
<key>name</key>
<string>code.bold.xmp</string>
</dict>
</array>
https://regex101.com/r/zC8mG5/8