fork(10) download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static bool validarData(string data)
  7. {
  8. Regex r = new Regex(@"(\d{2}\/\d{2}\/\d{4} \d{2}:\d{2})");
  9. return r.Match(data).Success;
  10. }
  11.  
  12. public static void Main()
  13. {
  14. Console.WriteLine(validarData("01/03/2010 23:00"));
  15. Console.WriteLine(validarData("0//03/2010 23::0"));
  16. }
  17. }
Success #stdin #stdout 0.03s 30488KB
stdin
Standard input is empty
stdout
True
False