static void Main(string[] args)
{
string[] ids = new string[]
{
"111111111111",
"999999999999",
"123456789012",
"456789012345",
"543044885000",
"124689124000",
"317238921101",
"772190300023"
};
string repeat = @"(?!(\d)\1+$)";
string sequence = @"(?!(012345678901|123456789012|234567890123|" +
"345678901234|456789012345|567890123456|" +
"678901234567|789012345678|890123456789|" +
"901234567890)$)";
string zeros = @"(?!\d{9}000$)";
string digits = @"\d{12}";
string regExp = String.Format(@"^{0}{1}{2}{3}$", repeat, sequence, zeros, digits);
foreach (string id in ids)
{
Console.WriteLine(Regex.IsMatch(id, regExp));
}
Console.ReadKey();
}
This code is working for c#. when we are coming to java script it is not working.
regular expression in c#.
string regExp ="^(?!(\d)\1+$)(?!(012345678901|123456789012|234567890123|345678901234|456789012345|567890123456|678901234567|789012345678|890123456789|901234567890)$)(?!\d{9}000$)\d{12}$"
Somebody help me how to convert this into JavaScript.
Thanks in advance.
Regards,
Ranganath Potluri