Private Sub Command1_Click()
Dim regEx As New RegExp
'regEx.Pattern = "(\<.*?\>).*?(\<\/.*?\>)"
regEx.Pattern = "\<.*?\>"
'regEx.Pattern = "<[^<>]+>"
regEx.Global = True
Set matches = regEx.Execute(rtbCode.Text)
Dim match As match
For Each match In matches
rtbCode.SelStart = match.FirstIndex
rtbCode.SelLength = match.Length
rtbCode.SelColor = colorMe(match.Value)
rtbCode.SelBold = True
Next
colorSpeech
End Sub
Function colorSpeech()
Dim regEx As New RegExp
'regEx.Pattern = "(\<.*?\>).*?(\<\/.*?\>)"
regEx.Pattern = "\'.*?\'"
'regEx.Pattern = "<[^<>]+>"
regEx.Global = True
Set matches = regEx.Execute(rtbCode.Text)
Dim match As match
For Each match In matches
rtbCode.SelStart = match.FirstIndex
rtbCode.SelLength = match.Length
rtbCode.SelColor = &H8000& 'colorMe(match.Value)
rtbCode.SelBold = False
Next
End Function