Regex with Accents

Hi. Sorry if my english is not very good.
I'm working in a function (VB) to Hightlight some text (Search_Str) in a big string (InputTxt) with this function that works OK. But... i need to do this function capable of working with áíóú (accents).
For example.
If i seach "hello" in the string i need to highlight "hllo", "helló", "hlló"... etc.
This is the function.

Function Highlight(Search_StrasString, InputTxtasString, StartTagasString, EndTagasString)AsString

Dim ResultStrAsString ResultStr = Regex.Replace(InputTxt, "(" &

Regex.Escape(Search_Str) & ")", StartTag & "$1" & EndTag, RegExOptions.IgnoreCase)

return ResultStr

EndFunction


Thanks a lot!!!
[1394 byte] By [Fametown.com] at [2008-1-10]
# 1
Try using character classing that allows unicode values. For instance, the accented "a" that you spoke of is \u00E1 in a regex and the accented "e" is \u00E1. Treat these escaped values as a single character in your regex. So, for instance, the regex to look for hllo would be ^h\u00E9llo$.

^ matches the beginning of the string (you may want to leave this off if you are searching for this within a string.)
\u00E9 matches the
ello matches the rest of the word
$ matches the end of the string (again, you may want to leave this off)
TobinTitus at 2007-9-8 > top of Msdn Tech,.NET Development,Regular Expressions...

.NET Development

Site Classified