leosco

leosco

  • NA
  • 13
  • 0

getting words that start with $

Sep 22 2010 1:49 PM
Hi again.


I am using a custom syntax highlighter where keywords are highlighted. Like:
string keys = "one two three four five";
tb. Keywords = keys;
I want to highlight all numbers (and hex numbers A-F too) which start with $. Like $13 or $2A for example should be highlighted. The problem is, is there any fast way of getting all of the numbers into the string instead of writing them all? Additionally, would it be possible to only highlight the word if it contains 3 digits ($xx), 5 digits ($xxxx) or 7 digits ($xxxxxx) (not really required but it would help). I think I should a Regex, but I'm not sure how I should use that. Any help would be appreciated.

Answers (5)