我正在爲6502彙編語言編寫定製的TextMate/Sublime Text 2
包。我該如何用正則表達式來做到這一點?
無論如何,我希望能夠識別的常量,變量等
我有這樣的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
感謝