Reputation: 6967
I've managed to put together a syntax (.tmLanguage) file for use in Sublime Text 2. I'd quite like to highlight numerals. I tried:
<string>0|1|2|3|4|5|6|7|8|9</string>
which works, but only for single digits, so I thought the regex would be
<string>[0-9]</string>
But that doesn't work. Can someone please help me with the correct syntax in Sublime?
Upvotes: 0
Views: 210
Reputation: 412
If you change your code to:
<string>\d+</string>
It should find all integers.
In your case, at least one digit, but as many as possible. Might I suggest:
<string>\d+(\.\d+)?</string>
as that will find decimal numbers as well.
That should capture both integers and decimal numbers.
Upvotes: 1