We use cookies to improve your experience, for authentication and to ensure that we show you advertising that is relevant to you. If you continue without changing your settings, we'll assume that you are happy to receive all cookies on Ideone website. However, if you wish, you can change cookie settings of your browser at any time.
language:
C# (mono-2.8)
date:
441 days 11 hours ago
link:
visibility:
publicprivateuser'sdeleted
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 staticvoid Main(){
string[] data ={"TE33","FR56","not","blahblahAJ00blah","ONetwo34"};
foreach(string myString in data){if(Regex.IsMatch(myString, @"^[A-Za-z]{2}.*\d{2}$")){
Console.WriteLine("{0} matches", myString);}else{
Console.WriteLine("{0} doesn't match", myString);}}}}