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.
Loading
Mahesh ChandPosted Sep 26, 2010, 10:49 AM
leoscoPosted Sep 26, 2010, 6:19 AM
leoscoPosted Sep 26, 2010, 3:26 AM
leoscoPosted Sep 23, 2010, 7:57 AM
Mike GoldPosted Sep 22, 2010, 4:42 PM
(?
Check out this web article
http://en.csharp-online.net/CSharp_Regular_Expression_Recipes%E2%80%94Extracting_Groups_from_a_MatchCollection to see how to use the Regex class to extract your numbers from a group.
You can also do the 3, 5, or 7, by using an | expression. Something like...
(?