fork(3) download
  1. using System;
  2. using System.Linq;
  3. using System.Text.RegularExpressions;
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. var s = "Please buy 40 kg of apples for 1350$ each, Please call 8 0 0 4 3 2 1 2 4 3 from 17:00 till 22:00, I would like to bid 50 euro on 20 black and pair of spades";
  9. var res = Regex.Matches(Regex.Replace(s, @"\W+", ""), @"\d+").Cast<Match>().Select(m=>m.Value).ToList();
  10. Console.Write(string.Join(", ", res));
  11. }
  12. }
Success #stdin #stdout 0.03s 30656KB
stdin
Standard input is empty
stdout
40, 1350, 8004321243, 1700, 2200, 50, 20