我正在解析日志文件并尝试匹配错误语句。我匹配“错误 CS”的那部分行将适用于许多行,有些重复有些不重复。有没有办法我不能返回重复项。使用 Java 风格的 RegEx..
示例:我的简单正则表达式返回
Class1.cs(16,27): error CS0117: 'string' does not contain a definition for 'empty'
Class1.cs(34,20): error CS0103: The name 'thiswworked' does not exist in the current context
Class1.cs(16,27): error CS0117: 'string' does not contain a definition for 'empty'
Class1.cs(34,20): error CS0103: The name 'thiswworked' does not exist in the current context
希望它返回:
Class1.cs(16,27): error CS0117: 'string' does not contain a definition for 'empty'
Class1.cs(34,20): error CS0103: The name 'thiswworked' does not exist in the current context