Will match any digit with four or more copies
string found = Regex.Match(s,@"(\d).*\1.*\1.*\1").Groups[1].Value;
Just an example of how to use it.
static void Main( string[] args )
{
string fail = "1234567890";
string s = "1231231222";
string mTxt = @"(\d).*\1.*\1.*\1";
Console.WriteLine( Regex.Match(s,mTxt).Success);
Console.WriteLine(Regex.Match(fail, mTxt).Success);
}
Taken on @Brads Comments below use
([0-9]).*\1.*\1.*\1
rerun source
share