I am trying to create regex for below case:
- Input string consisting of all numbers, max length is 30.
- Check if in first 10 digits, any number is not consecutively appearing equal or more than 3 in length
eg.
1234567 --> is good (no consecutive number)
1234456 --> is good (4 appears consecutive but length is less than 3)
1234445 --> is bad (4 appears consecutive and length is equal or greater than 3)
12345678904444 --> is good (4 appears consecutive and length is greater than 3 however it is accepted since it is appearing after cut off of 10 digit)
The regex I came up with is below. pardon me for my mistake if any in regex, i am still in learning mode with regexes: https://regex101.com/r/rv5e6a/1
currently it is getting applied all across the string but not sure how to limit so that regex can be applied only for first 10 digits only.