Regex to find repeatitive number

Hi Team,

Could someone help me in regex to identify if a pattern contains any consecutive numbers or repetitive

e.g 123456789 - It needs to be identified
4444444444 or 77777777 (like any single repetitive number) - Needs to be identified


It’s a bit long, but you could use 0{2,}|1{2,}|2{2,}|3{2,}|4{2,}|5{2,}|6{2,}|7{2,}|8{2,}|9{2,}.

This detects any 2 or more consecutive numbers.

Thank you. How to find consecutive number like 123456789

Unfortunately, I don’t think there’s a regex for repetition of variable-length numbers. This would require finding each value in the string with \d+, and then taking each value found and checking if single digits are repeated, 2 digits, 3, etc through the length of the value found divided by 2.