fork(13) download
  1. using System;
  2. using System.Text.RegularExpressions;
  3. using System.IO;
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. Console.WriteLine(IsName("D'Antonio, Patricia"));
  9. }
  10. public static bool IsName(string input)
  11. {
  12. if (string.IsNullOrEmpty(input)) return false;
  13. if (Regex.IsMatch(input, @"^[A-Za-z0-9_']+\s?,\s?[A-Za-z0-9_']+"))
  14. return true;
  15. else
  16. return false;
  17. }
  18. }
Success #stdin #stdout 0.11s 24720KB
stdin
Standard input is empty
stdout
True