string str = "asdsad[00ff00]qwewqe"; str = Regex.Replace(str, @"\[([a-f]|[0-9]){6}\]", "", RegexOptions.IgnoreCase); Console.WriteLine(str); Console.Read();
类似“[你好]”,这种不会被忽略掉。只会忽略[6个字符]