Regular expressions negative lookahead
问题 I'm doing some regular expression gymnastics. I set myself the task of trying to search for C# code where there is a usage of the as-operator not followed by a null-check within a reasonable amount of space. Now I don't want to parse the C# code. E.g. I want to capture code snippets such as var x1 = x as SimpleRes; var y1 = y as SimpleRes; if(x1.a == y1.a) however, not capture var x1 = x as SimpleRes; var y1 = y as SimpleRes; if(x1 == null) nor for that matter var x1 = x as SimpleRes; var y1