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 line = @" 13.5 0.12557 0.04243 -0.0073 0.00377
  12. 14 0.12573 0.05 -0.00697 0.00437
  13. 14.5 0.12623 0.05823 -0.00703 0.005
  14. 15 0.12853 0.0686 -0.00627 0.00493
  15. 15.5 0.1299 0.08073 -0.00533 0.0063";
  16. var results = line.Split(new[] {"\r", "\n"}, StringSplitOptions.RemoveEmptyEntries)
  17. .Select(v => v.Split(new[] {" "}, StringSplitOptions.RemoveEmptyEntries).Skip(1))
  18. .SelectMany(x => x);
  19. Console.WriteLine(string.Join(",",results));
  20. var results2 = Regex.Matches(line, @"(?m)(?<!^[\p{Zs}\t]*)(?<=[\p{Zs}\t])-?[0-9]*\.?[0-9]+(?:[eE][-+]?[0-9]+)?")
  21. .Cast<Match>()
  22. .Select(m => m.Value);
  23. Console.WriteLine(string.Join(",",results2));
  24.  
  25. }
  26. }
Success #stdin #stdout 0.09s 21096KB
stdin
Standard input is empty
stdout
0.12557,0.04243,-0.0073,0.00377,0.12573,0.05,-0.00697,0.00437,0.12623,0.05823,-0.00703,0.005,0.12853,0.0686,-0.00627,0.00493,0.1299,0.08073,-0.00533,0.0063
0.12557,0.04243,-0.0073,0.00377,0.12573,0.05,-0.00697,0.00437,0.12623,0.05823,-0.00703,0.005,0.12853,0.0686,-0.00627,0.00493,0.1299,0.08073,-0.00533,0.0063