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.
To be honest, your solution outsmarted mine. I have to admit that i didn't even think of this solution, and if I had, I would've gone for it definitely. I went for the complex regex right away LOL!
To my defense, and despite this not being the case, I have to say that the regex solution would be the best practice in a production env for example, where you don't know whether the protocols / domains are likely to change or not. But, of course, the kata didn't specify any of that sooo GGs well played haha.
Keep it simple!
The purpose of the exercise is whatever you make it to be within the specified constraints. I'd say this is a win. The alternative is a regular expression with complex look-behinds. My own version, which is nearly identical, happens to require the strings appear at the beginning--but even that may be excessively robust.
This comment is hidden because it contains spoiler information about the solution