We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
python 3
Regex_Pattern = r"^\d{2}\D\d{2}\D\d{4}$" # Do not delete 'r'.
Returns failure for test case 4
10a10.2015452254
Why is the expected result true? 10a10.2015452254 is not of the form xxXxxXxxxx but rather xxXxxXxxxxxxxxxx. It should not match and the previous question complained about loosing matchin by failing to end with $. Why the inconsistancy?
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Matching Digits & Non-Digit Characters
You are viewing a single comment's thread. Return to all comments →
python 3 Regex_Pattern = r"^\d{2}\D\d{2}\D\d{4}$" # Do not delete 'r'.
Returns failure for test case 4 10a10.2015452254 Why is the expected result true? 10a10.2015452254 is not of the form xxXxxXxxxx but rather xxXxxXxxxxxxxxxx. It should not match and the previous question complained about loosing matchin by failing to end with $. Why the inconsistancy?