I have text containing Unicode characters (like ,)
Now I want to search this text for single characters or words using RegEx and highlight the found matches.
my searchpattern: ("\b" + searchText + “\b”) for search on whole word only or just (“searchText”) for any match.
this is my search routine:
match = me.Search(m_inText)
while match <> nil
idx = match.SubExpressionStartB(0)
len = len(match.SubExpressionString(0))
range.index = idx
range.length = len
m_matches.Append(range)
match = me.Search()
wend
this function returns an array of ranges which I use with styled text to highlight all matching words/characters.
it is working ok as long as the text to search has no Unicode characters.
Problem: all highligted matches are shifted 1 to the right after an Unicode character in text.
e.g
text: meem
search for e
first e is highlighted correct, second e is not highlighted but charater m is highlighted.
any Help?