((?!(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

相关文章:

  • 2021-12-14
  • 2022-12-23
  • 2021-07-23
  • 2021-08-04
  • 2021-07-11
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-31
  • 2022-12-23
相关资源
相似解决方案