5 kyu

Domain name validator

335 of 574Disassembler0
Description
Loading description...
Regular Expressions
Strings
Fundamentals
  • Please sign in or sign up to leave a comment.
  • ahmet_popaj Avatar

    Fancy kata on pattern matching, I really like it.

  • cleverboy1 Avatar

    The rules are somewhat vague, but I really enjoyed creating efficient regex for this kata.

  • ah2023 Avatar

    In the test category "LengthTests" I think instead of "some-horribly-long-domain-name-this-time-longer-than-63-charaters.zzz" the given text should be "some-horribly-long-LEVEL-name-this-time-longer-than-63-charaters.zzz".

    As the level name is longer than 63 characters I think the result for this test should be false not true. BUT I am not quite sure because it is not clear from the output which test of the test category it refers to.

  • mauro-1 Avatar

    Python fork with random tests and standard failure messages: https://www.codewars.com/kumite/64b321a2206744001d337b9e?sel=64b321a2206744001d337b9e

  • evanrh Avatar

    Submitted a Javascript translation for this kata.

  • SerGreen Avatar

    My solution [python] is passing all of the tests except one and i have no idea what is wrong because all it says is "value is not what was expected". But what was expected? I only know it's something about length, but i already tried every "missed by one" possible errors and no luck.

    What does the 7th test in the length group test for?

  • hobovsky Avatar

    Python: tests use test.expect, what makes failed tests emit poor failure messages.

  • hobovsky Avatar

    Python update to decorator syntax.

  • albertogcmr Avatar

    This comment has been hidden.

  • lrasheed Avatar

    Great Kata!!!

  • stundzia Avatar

    Broken, on attempt the following error occurs (unrelated to solution code): File "main.py", line 42 SyntaxError: Non-ASCII character '\xc5' in file main.py on line 42, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

  • Blind4Basics Avatar

    Hi,

    I encounter some weird things, in the python version. Meanning: things that seem incoherent with the description (but maybe I did not understand what was said...) :

    • "Top level validation must be naive - ie. TLDs nonexistent in IANA register are still considered valid as long as they adhere to the rules given above." => I understand that '' as TLD is valid, but see example tests : not validate('.codewars.com') => !???
    • "Top level (TLD) must not be fully numerical" => but validate('1234.com')) is excpected to be True => !??!!??
    • and that seems not coherent with validate('127.0.0.1')) which is expected to be invalid...

    Seems to me that is inconsistent... Or what did I miss ? (I'm a bit lost, here...)

  • donaldsebleung Avatar

    [PHP Version] Good code coverage with plenty of fixed assertions and a few edge cases but it would still be good to see random tests implemented sometime to further prevent hardcoded and/or logically flawed solutions from passing. Anyway, consider your Kata approved :D

  • gabbek Avatar

    Great kata, thank you :)