Here are several approaches to match a digit n times
Learn Regex (Regular Expressions) by examples with beginner's guide. You will find how they work and how to use them in a range of common scenarios - validations for - numbers, dates, capital letters, groups, cheat sheets. You can find how to use regex in programming languages and also in text editors.
The most complete list of popular topics related to Python,
This post cover advanced techniques for regex extraction from text.
In this post: * python regex match * python regex search * python
You can check other example here: Notepad++ regex replace capture
you can check also: java regex matcher example Java regular