fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text.RegularExpressions;
  6.  
  7. public class Test
  8. {
  9. public static void Main()
  10. {
  11. var text = "not BATTCOMPAR{275} and FORKCARRIA{ForkSpreader} and SIDESHIFT{WithSSPassAttachCenterLine} and TILTANGLE{4up_2down} and not AUTOMATSS{true} and not FORKLASGUI{true} and not FORKCAMSYS{true} and OKED{true}\nCONTAINER{Container}";
  12. var results = Regex.Matches(text, @"\b((?:and|or)(?:\s+not)?|not)?\s*(\w+){([^{}]*)}");
  13. foreach (Match m in results)
  14. {
  15. Console.WriteLine("{0} : {1} : {2}", m.Groups[1].Value, m.Groups[2].Value, m.Groups[3].Value);
  16. }
  17. }
  18. }
Success #stdin #stdout 0.08s 27900KB
stdin
Standard input is empty
stdout
not : BATTCOMPAR : 275
and : FORKCARRIA : ForkSpreader
and : SIDESHIFT : WithSSPassAttachCenterLine
and : TILTANGLE : 4up_2down
and not : AUTOMATSS : true
and not : FORKLASGUI : true
and not : FORKCAMSYS : true
and : OKED : true
 : CONTAINER : Container