Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I would've solved this had I know that the only possible subdomain is "www".
Description not detailed enough. It should be clarified that www is the only subdomain and http(s):// the only protocol being tested against.
Current solutions will not work reliably for most real-world URL's.
Here are some url-patterns that should also be tested:
The wording of the description is confusing as it actually wants a hostname returned, not a domain name. Aditionally, I encountered issues around the .co.za TLD
How is this an issue though? (Its just a miswording not an issue, the problem tells you what you need to do, so just do it or find other problems if you aren't satisfied with that detail).
hey, I'm getting this error (first letter of sime tests being left out)
'yphen-site' should equal 'hyphen-site'
does anyone have any suggestions as to why this might be in my code?
If this kata is to be an exercise in regular expressions, its description should be updated to indicate that it is not looking for the actual domain in the URL, only a kind of approximation to it.
Because practically every solution that is currently accepted is incorrect--when using a more accurate definition of "domain".
For example, most solutions seem to hardcode "www." as being the only possible (optional) sub-domain. So that given the URL "subdomain.domain.tld", many solutions would return "subdomain" as the domain. And given the URL "nested.subdomain.domain.co.uk", many solutions would return "nested" as the domain.
I scrolled through a few ~pages of solutions, and not one of them would be able to accurately return the domain in those cases. Even the solution I submitted is not complete.
I understand the intent of the kata as an exercise for regular expressions, but it should be updated to reflect the fact that isn't actually looking for a proper domain (unless my definition of domain is different from everyone else's).
The function
domainName
should only have one argument. The domain name is the solution you have to return.This comment is hidden because it contains spoiler information about the solution
showing your code is not a suggestion. you are not supposed to reveal code / methods to others that haven't solved the kata yet, anyway. so, that's why your comment is spoilered. a suggestion is intended for when you have an idea on how to improve the kata
you must use the given function name
(so, yes, your code)
not a kata issue
Is it normal to get this error when i test my code?
Don't post solutions in discourse please. And use proper code formatting.
Use the spoiler flag please.
This comment is hidden because it contains spoiler information about the solution
Would be better if the description specified that the test cases are not expecting sub-domains (other than www). Most of the solutions here (including mine ;)) would fail on a URL like https://dev.example.com/.
Loading more items...