Hey! nadolski's explenation is much better than I could give at the moment as I'm new to regex and this one is partially taken from stack overflow and partialy changed by me!
Good solution, but it must be like this: /.+//|www\.|..+/g ("\" after "www"). Because the URL "http://www4cnet.com" will reutrn 'cnet' instead of 'www4cnet'.
The moment i saw the question i understood i had to use regex but i am not good at it, probably scared of the syntax. But this looks good and i will definitely check the solution.
Very slowly =/
does or(|) always go left to right with "g" ? (bc www.|\..+ doesn't touch the domain that also starts with a dot)
Hey! nadolski's explenation is much better than I could give at the moment as I'm new to regex and this one is partially taken from stack overflow and partialy changed by me!
Good solution, but it must be like this: /.+//|www\.|..+/g ("\" after "www"). Because the URL "http://www4cnet.com" will reutrn 'cnet' instead of 'www4cnet'.
The moment i saw the question i understood i had to use regex but i am not good at it, probably scared of the syntax. But this looks good and i will definitely check the solution.
up!!!
I liked this one.
This comment is hidden because it contains spoiler information about the solution