fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8.  
  9.  
  10. String input = @"word1 word2 word3 word4 word5";
  11. Regex rgx = new Regex(@"\S+\s+\S+");
  12. int NumberOfTrues = rgx.Matches(input).Count;
  13. Console.WriteLine(NumberOfTrues);
  14. }
  15. }
Success #stdin #stdout 0.07s 24488KB
stdin
Standard input is empty
stdout
2