... ...I have a list as: ABC-283 373 34948 DEF-093 397 ABDDE HJH-237 AGB 27338 JJJ-ABC 373 37293 KKK-LLL MMM nnnnn MMM-273 331 93744 ... ... How to only selected all non-specific started tag? e.g. Only select all not DEF, JJJ and MMM lines, the expected result as: ABC-283 373 34948 HJH-237 AGB 27338 KKK-LLL MMM nnnnn ... ...推荐答案 Regex reg = new Regex( " ^(DEF | JJJ | MMM)"); foreach(行中的字符串行) {匹配m = reg.Match(行); if(!m.Success) {Console Console.WriteLine(line); } }Regex reg = new Regex("^(DEF|JJJ|MMM)");foreach(string line in lines){Match m = reg.Match(line);if (!m.Success){ Console.WriteLine( line );}} 这篇关于如何选择非特定的开始标记行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 阿里云证书,YYDS! 05-21 13:53