fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. string[] data = new[] {
  9. "aaa123", "123aaa", "123", "aaa", "a 1"
  10. };
  11. Regex r = new Regex("[A-Za-z]+[0-9]+");
  12. foreach (string s in data) {
  13. Console.WriteLine("{0} - {1}", s, r.IsMatch(s));
  14. }
  15. }
  16. }
Success #stdin #stdout 0.06s 34816KB
stdin
Standard input is empty
stdout
aaa123 - True
123aaa - False
123 - False
aaa - False
a 1 - False