Before I had regex as [4569]{1}[0-9]{7}
to check whether the number starts with 4569 & rest 7 digits are numbers or not.
Now, I wanted to update to as below.
First 2 characters are either as 31,33,55,66,77 & rest 6 digits are numbers.
So I update to [31|33|55|66|77]{2}[0-9]{6}
but it’s not working.
Anyone can point me what I am missing here?
Even I tried (31|33|55|66|77){2}[0-9]{6}
I tried against below strings where [31|33|55|66|77]{2}[0-9]{6}
pass for both string.
51123456
55123456
Sample to check
https://regexr.com/7vdgr
Your statement:
[31|33|55|66|77]{2}[0-9]{6}
{2} is not needed here, like that you search for two occurences of one of the numbers in the [31|33|55|66|77] group.
use instead:
[31|33|55|66|77][0-9]{6}