我正在TextMate / Sublime Text 2
为 6502 汇编语言编写一个自定义包。
无论如何,我希望能够识别常量、变量等。
我有这个HEX
数字:
<dict>
<key>match</key>
<string>#?\#[0-9a-fA-F]+</string>
<key>name</key>
<string>constant.numeric.decimal</string>
</dict>
但它实际上不适用于以下情况:
#14 // works
#$2F // works
#coolVariable // doesn't work. The "#c" is caught and colored but the rest is not.
// In this case, I DON'T want any of it to be colored.
就像代码说的那样,它不应该给它着色,#coolVariable
但它会抓住#c
它的一部分。
我想单独为这样的变量着色。区分这两种模式的正则表达式是什么?
以便:
#c0 // Caught by one pattern (values in decimal or hexadecimal or binary)
#%10101 // Caught by one pattern (values in decimal or hexadecimal or binary)
#c0BLAH // Caught by another pattern
谢谢