Greeeg wrote:
How to do this correctly?
I would use explicit captures, eg:
(?<brown>brown)\s+(?<fox>fox)
Match m = Regex.Match();
return m.Groups["brown"].Success && !m.Groups["fox"].Success;
or even easier:
return !Match("brown\s+fox");
xacc-ide 0.0.99-preview5 now with C#, C, IL, XML, Nemerle, IronPython and Boo highlighting support!