language: C# (mono-2.8)
date: 442 days 1 hour ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
using System;
using System.Text.RegularExpressions;
 
public class Test
{
        public static void Main()
        {
                string[] data = {"TE33", "FR56", "not", "blahblahAJ00blah"};
 
                foreach(string myString in data) {
                    if(Regex.IsMatch(myString, "^[A-Za-z]{2}[0-9]{2}$")) {
                        Console.WriteLine("{0} matches", myString);
                    } else {
                        Console.WriteLine("{0} doesn't match", myString);
                    }
                }
        }
}
  • upload with new input
  • result: Success     time: 0.05s    memory: 37224 kB     returned value: 0

    TE33 matches
    FR56 matches
    not doesn't match
    blahblahAJ00blah doesn't match