fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. string pattern = @"(?<=\d)\s+(?=(?:\d+\s+)*\d+\s+(?:eur|usd)\b)";
  9. string substitution = @"";
  10. string input = @"sdklfjsd 10 343 usd ds 232 300 eur
  11.  
  12. sdklfjsd 10 343 usd ds 232 300 eur test
  13. 2 300 $ 12 Asdsfd 2 300 530 usd and 2 351 eur";
  14. RegexOptions options = RegexOptions.Multiline;
  15.  
  16. Regex regex = new Regex(pattern, options);
  17. string result = regex.Replace(input, substitution);
  18. Console.WriteLine(result);
  19. }
  20. }
Success #stdin #stdout 0.03s 134592KB
stdin
Standard input is empty
stdout
sdklfjsd 10343 usd ds 232300 eur

sdklfjsd 10343 usd ds 232300 eur    test
2 300 $ 12 Asdsfd 2300530 usd and 2351 eur