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.
right now the pattern ^(.{3}\.?){4}$ passes all the test case, but this violates the problem statement that the pattern needs to strictly follow a period after the first three charcters. for example "abcdefghijkl" passes the test, when it shouldn't.
short solution not violating this constraint can be something like ^...(\....){3}$ which enforces the \.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Matching Anything But a Newline
You are viewing a single comment's thread. Return to all comments →
I noticed a big flaw in the test case.
right now the pattern
^(.{3}\.?){4}$
passes all the test case, but this violates the problem statement that the pattern needs to strictly follow a period after the first three charcters. for example "abcdefghijkl" passes the test, when it shouldn't.short solution not violating this constraint can be something like
^...(\....){3}$
which enforces the\.