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 s = "pops + nt1s11.75%";
  12. var pat = @"(\w+)\s*\+\s*(\w+?)\(?(\d*\.\d+)";
  13. var r = Regex.Match(s, pat);
  14. if (r.Success)
  15. Console.Out.WriteLine("{0}\n{1}\n{2}", r.Groups[1].Value, r.Groups[2].Value, r.Groups[3].Value);
  16.  
  17. }
  18. }
Success #stdin #stdout 0.1s 24312KB
stdin
Standard input is empty
stdout
pops
nt1s
11.75