- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to write Python Regular Expression find repeating digits in a number?
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
- Related Articles
- How to match only digits in Python using Regular Expression?
- How to write a Python regular expression to use re.findall()?
- How to write a Python Regular Expression to validate numbers?
- How to match only non-digits in Python using Regular Expression?
- What are repeating character classes used in Python regular expression?
- How to write a case insensitive Python regular expression without re.compile?
- How to write Python regular expression to check alphanumeric characters?
- How to write a Python regular expression to get numbers except decimal?
- How to write a Python regular expression to match multiple words anywhere?
- How to write a regular expression to match either a or b in Python?
- How to write a Python regular expression that matches floating point numbers?
- How to write Python regular expression to match with file extension?
- How to match digits using Java Regular Expression (RegEx)
- How to write a Regular Expression in JavaScript to remove spaces?
- How to write Python regular expression to get all the anchor tags in a webpage?

Advertisements