using System.Text.RegularExpressions;
public static void Main()
Console.WriteLine(IsVisaCard("4111111111111112"));
Console.WriteLine(IsVisaCard("378282246310005"));
Console.WriteLine(IsVisaCard("411111"));
public static bool IsVisaCard(string number) => Regex.Match(number, @"^4[0-9]{12}(?:[0-9]{3})?$").Success;