fork(1) download
  1. using System;
  2. using System.Linq;
  3. using System.IO;
  4. using System.Text.RegularExpressions;
  5.  
  6. public class Test
  7. {
  8. public static void Main()
  9. {
  10. var strs = new string[] {"16440 dallas", "23941 cityO ", "931 00 Texas", "10581 New Orleans"};
  11. foreach (var s in strs) {
  12. var match = Regex.Match(s, @"(\p{L}+)\s*$");
  13. if (match.Success)
  14. {
  15. Console.WriteLine(match.Groups[1].Value);
  16. }
  17. }
  18.  
  19. }
  20. }
Success #stdin #stdout 0.11s 24864KB
stdin
Standard input is empty
stdout
dallas
cityO
Texas
Orleans