fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. string[] lines = {
  9. "Foo 12;",
  10. "Foo 5534;",
  11. "Foo 1;"
  12. };
  13. foreach (String line in lines) {
  14. Console.WriteLine(Regex.Replace(line, @"(Foo) \d+;", "$1 NUM;"));
  15. }
  16. }
  17. }
Success #stdin #stdout 0.04s 134592KB
stdin
Standard input is empty
stdout
Foo NUM;
Foo NUM;
Foo NUM;