fork(36) download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. string s1 = "thisIsaString-A21";
  9. Console.WriteLine(Regex.IsMatch(s1, @"-A\d"));
  10.  
  11. string s2 = "thisIsaString-AB21";
  12. Console.WriteLine(Regex.IsMatch(s2, @"-A\d"));
  13. }
  14. }
Success #stdin #stdout 0.06s 37232KB
stdin
Standard input is empty
stdout
True
False