正则: 匹配除了某些单词之外的其他单词

 ((?!(p|img)) 表示除了p和img单词的其他单词 

用法:

var phone = "##024-123456aaa";

phone = Regex.Replace(phone, @"(?!(-))D", string.Empty);

//phone : 024-123456

引用: 

http://blog.sina.com.cn/s/blog_654116410102yo5u.html

原文地址:https://www.cnblogs.com/adinet/p/10538061.html