fork download
  1. using System.Text.RegularExpressions;
  2. using System;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. String s = "0787654321";
  9. if (!Regex.IsMatch(s, @"^078\d{7}")) {
  10. Console.WriteLine("Error! Wrong format.");
  11. }
  12. else {
  13. Console.WriteLine("Correct format.");
  14. }
  15. }
  16.  
  17. }
Success #stdin #stdout 0.06s 34088KB
stdin
Standard input is empty
stdout
Correct format.