Matching Anything But a Newline

Sort by

recency

|

409 Discussions

|

  • + 0 comments

    I think we have a wrong test cases here. pattern /(.{3}.){3}.{3}/ with string 1123.456.abc.def must return false. How can it return true In PHP and JavaScript it works wrong, but if I select python it works but failed in another cases.

  • + 0 comments

    So, it was something as simple as ^...\....\....\....$

  • + 0 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 \.

  • + 0 comments

    Requirements are ambiguous and the comma at the end of the instruction string is hard to see in the given font. I thought the text had to end with a period because the comma's tail is indiscernible (to me).

    I suggest restating the question such that it is more accessible to those with vision problems.

  • + 0 comments

    var pattern = Pattern.compile("...\....\....\....");