I really liked this solution, however I found a little bug.
The '.' in 'www.' currently matches any character, which means if my input is 'wwwsomething.com' the function will return very weird values, depending on the number of w's.
I suppose you meant to write that as 'www\.', to match only dots.
This comment is hidden because it contains spoiler information about the solution
I really liked this solution, however I found a little bug.
The '.' in 'www.' currently matches any character, which means if my input is 'wwwsomething.com' the function will return very weird values, depending on the number of w's.
I suppose you meant to write that as 'www\.', to match only dots.