# Matching Zero Or More Repetitions – HackerRank Solution

In this post, we will solve Matching Zero Or More Repetitions HackerRank Solution. This problem (Matching Zero or More Repetitions) is a part of HackerRank Regex series.

Contents

## Objective

*
TheÂ *Â tool will match zero or more repetitions of character/character class/group.

For Example:

w*Â : It will match the characterÂ `w`Â 0Â or more times.
[xyz]*Â : It will match the charactersÂ `x`,Â `y`Â orÂ `z`Â 0Â or more times.
\d*Â : It will match any digitÂ 0Â or more times.

You have a test stringÂ S.
Your task is to write a regex that will matchÂ SÂ using the following conditions:

• SÂ should begin withÂ 2Â or moreÂ `digits`.
• After that,Â SÂ should haveÂ 0Â or moreÂ `lowercase letters`.
• SÂ should end withÂ 0Â or moreÂ `uppercase letters`

Note

This is a regex only challenge. You are not required to write any code.
You have to fill the regex pattern in the blank (`_________`).

## Solution – Matching Zero Or More Repetitions – HackerRank Solution

### Python

```Regex_Pattern = r'^\d{2,}[a-z]*[A-Z]*\$' # Do not delete 'r'.

import re

print(str(bool(re.search(Regex_Pattern, input()))).lower())
```

Note: This problem (Matching Zero Or More Repetitions) is generated by HackerRank but the solution is provided by CodingBroz. This tutorial is only for Educational and Learning purpose.