# Matching One Or More Repetitions – HackerRank Solution

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

Contents

## Objective

+
TheÂ +Â tool will match one or more repetitions of character/character class/group.

For Example:

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

## Task

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Â 1Â or moreÂ `digits`.
• After that,Â SÂ should haveÂ 1Â or moreÂ `uppercase letters`.
• SÂ should end withÂ 1Â or moreÂ `lowercase 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 (`_________`).

## Matching One Or More Repetitions – HackerRank Solution

### Python

```Regex_Pattern = r'^\d+[A-Z]+[a-z]+\$'    # Do not delete 'r'.

import re

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

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