I have the following regex:
foo =开发者_高级运维 Regex.Replace(foo, @"[^a-zA-Z0-9\s-]", " ");
Currently, this removes Unicode characters. What regex can I use remove all non-URL friendly characters (i.e. : , < etc.), but allow Unicode and accented characters?
Thanks, Mark
How about instead of using a negated class, you simply have a replacement list of the characters you dont want?
s/[:,<]*//g
Microsoft.Security.Application.AntiXss.GetSafeHtml()
solved my problem.
精彩评论