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