fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. Console.WriteLine(Regex.IsMatch("abc123", "^.[pr]|[A-Za-z]$"));
  9. Console.WriteLine(Regex.IsMatch("abc12x", "^.[pr]|[A-Za-z]$"));
  10. Console.WriteLine(Regex.IsMatch("apc123", "^.[pr]|[A-Za-z]$"));
  11. Console.WriteLine(Regex.IsMatch("arc123", "^.[pr]|[A-Za-z]$"));
  12. Console.WriteLine(Regex.IsMatch("", "^.[pr]|[A-Za-z]$"));
  13. }
  14. }
Success #stdin #stdout 0.08s 29092KB
stdin
Standard input is empty
stdout
False
True
True
True
False