I want to combine the two regex.
/^([a-z]{2})?([0-9]+)$/gi and /^(?!.*?([0-9])\1{3})\S+$/gi
something like this /(([a-z]{2})?([0-9]+)) || ((?!.*?([0-9])\1{3})\S+)/gi and this /(([a-z]{2})?([0-9]+)) && ((?!.*?([0-9])\1{3})\S+)/gi
So I need both the above two separate regex combined in one regex format.
I need both or(||) as well as and(&&).
what the above regex code actually does is:
Below is to check for, not allow more than 3 same character:
/^(?!.*?([0-9])\1{3})\S+$/gi.test("4444") => false
/^(?!.*?([0-9])\1{3})\S+$/gi.test("11222") => true
/^(?!.*?([0-9])\1{3})\S+$/gi.test("77722") => true
Below is for to check, not more than 2 characters at beginning and followed by only numbers:
/^(([a-z]{1,2})?([0-9]+))$/gi.test('sj76755') => true
/^(([a-z]{1,2})?([0-9]+))$/gi.test('k4545') => true
/^(([a-z]{1,2})?([0-9]+))$/gi.test('6j53') => false
/^(([a-z]{1,2})?([0-9]+))$/gi.test('653aa') => false
/^(([a-z]{1,2})?([0-9]+))$/gi.test('ss653aa') => false
So I need both the above two separate regex combined in one regex format.
I need both or(||) as well as and(&&).
Thanks in advance
0000oraa0000? Shouldaa0pass?