fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text.RegularExpressions;
  6.  
  7. public class Test
  8. {
  9. public static void Main()
  10. {
  11. var rx = "[a-zA-Z0-9]N[a-zA-Z0-9]{4}[0-9][a-zA-Z0-9]|([a-zA-Z0-9]{6}[0-9][a-zA-Z0-9])|[a-zA-Z0-9]{6}[a-zA-Z][a-zA-Z0-9]";
  12. var results = Regex.Matches("BJX4700QHJ43EKU2KU89EJKM", rx)
  13. .Cast<Match>()
  14. .Where(m => !m.Groups[1].Success)
  15. .Select(z => z.Value);
  16. foreach (var s in results)
  17. Console.WriteLine(s);
  18. }
  19. }
Success #stdin #stdout 0.04s 134592KB
stdin
Standard input is empty
stdout
HJ43EKU2
KU89EJKM