How to write Python Regular Expression find repeating digits in a number?

PythonServer Side ProgrammingProgramming

The following code using Python regex to find the repeating digits in given string

Example

import re
result = re.search(r'(\d)\1{3}','54222267890' )
print result.group()

Output

This gives the output

2222
raja
Published on 10-Jan-2018 14:29:31
Advertisements