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.
The + tool will match one or more repetitions of character/character class/group.
w+ : It will match the character
w 1 or more times.
[xyz]+ : It will match the character
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
- After that, S should have 1 or more
- S should end with 1 or more
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
Regex_Pattern = r'^\d+[A-Z]+[a-z]+$' # Do not delete 'r'. import re print(str(bool(re.search(Regex_Pattern, input()))).lower())