Try this
I just tested it and it worked aok.Code:Regex.Replace(sHTMLstream, "\bvb\b", "C#", RegexOptions.IgnoreCase)
The reason yours didn't work was because of your pattern.
you put two slashes before the first wordboundary, a double slash is when you wish to include a slash literal (i.e your match will contain a "\" so you don't want the metacharacter) In effect, the pattern YOUR RegEx was looking for was the literal: "\bvb", which isn't what you want.Code:pattern = "\\bvb\b"






Reply With Quote