Positive Lookbehind – HackerRank Solution

In this post, we will solve Positive Lookbehind HackerRank Solution. This problem (Positive Lookbehind) is a part of HackerRank Regex series.

Solution – Positive Lookbehind – HackerRank Solution


Regex_Pattern = r'(?<=[13579])\d'

import re

Test_String = input()

match = re.findall(Regex_Pattern, Test_String)

print("Number of matches :", len(match))

Note: This problem (Positive Lookbehind) is generated by HackerRank but the solution is provided by CodingBroz. This tutorial is only for Educational and Learning purpose.

Leave a Comment

Your email address will not be published. Required fields are marked *