Dim pattern As String = "efg" Dim matches = System.Text.RegularExpressions.Regex.Matches(RichTextBox1.Text, pattern) For Each match As System.Text.RegularExpressions.Match In matches Dim start As Integer = match.Index Dim length As Integer = match.Length RichTextBox1.Select(start, length) RichTextBox1.SelectionColor = Color.Red Next