fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. class Demo {
  5. public static void Main()
  6. {
  7. Regex re = new Regex(@"^[-a-z0-9_@]{3,15}$");
  8. Console.WriteLine(re.IsMatch("a_b"));
  9. Console.WriteLine(re.IsMatch("abxyz1234567890"));
  10. Console.WriteLine(re.IsMatch("a!!"));
  11. Console.WriteLine(re.IsMatch("abxyz12345678901234"));
  12. }
  13. }
  14.  
Success #stdin #stdout 0.06s 34080KB
stdin
Standard input is empty
stdout
True
True
False
False