How can I paint in red every time I meet the letter \"A\" in RichTextBox?
This won't work while you are typing if that is what you are looking for, but I use this to highlight substrings:
Function Highlight(ByVal Search_Str As Object, ByVal InputTxt As String, ByVal StartTag As String, ByVal EndTag As String) As String
Highlight = Regex.Replace(InputTxt, "(" & Regex.Escape(Search_Str) & ")", StartTag & "$1" & EndTag, RegexOptions.IgnoreCase)
End Function
and call it this way:
Highlight("A", "Color All my A's red", [span class=highlight]', '[/span]')
Where the class 'highlight' has whatever color coding/formatting you want:
.highlight {text-decoration: none;color:black;background:red;}
BTW: you need to change those square brackets to angled ones...they wouldn't come thru when I typed them...