# HackerRank Matching One Or More Repetitions Solution

Hello Programmers, In this post, you will learn how to solve HackerRank Matching One Or More Repetitions Solution. This problem is a part of the Regex HackerRank Series.

One more thing to add, don’t straight away look for the solutions, first try to solve the problems by yourself. If you find any difficulty after trying several times, then look for the solutions. We are going to solve the  Regex HackerRank Solutions using  CPP, JAVA, PYTHON, JavaScript & PHP Programming Languages.

## HackerRank Matching One Or More Repetitions Solution

+
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.

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 (`_________`).

### HackerRank Matching One Or More Repetitions Solution in Java

```public class Solution {

public static void main(String[] args) {

Regex_Test tester = new Regex_Test();
tester.checker("^[0-9]+[A-Z]+[a-z]+\$"); // Use \\ instead of using \

}
}```

### HackerRank Matching One Or More Repetitions Solution in Python

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

### Matching One Or More Repetitions Solution in JavaScript

`var Regex_Pattern = /^\d+[A-Z]+[a-z]+\$/;`

### Matching One Or More Repetitions Solution in PHP

`\$Regex_Pattern = "/^[0-9]+[A-Z]+[a-z]+\$/"; //Do not delete '/'. Replace __________ with your regex. `

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

Sharing Is Caring