Hi Bruno,
I am sorry, I posted the other pattern, this is the one I was trying -
pattern = r’https{0,1}://([\w-]{1,}.[\w-]{1,}.{0,1}[\w-]{0,})’
It is same as r’https?://([\w-]+.[\w-]+.?[\w-]*)’ In the topic post I mistakenly wrote ? instead of * at the end.
Hi @Bruno, somehow posting the reply removed the backslashes present before the ‘.’ character in the pattern as the code was not between backticks, apologies for the confusion, I have edited the pattern in the main post. Here it is again -
Yes, I don’t think this is going in the right direction. Take a look at what happens with http://ftp://ftp.tcl.tk/pub/incoming/p15/RichardHipp/microoptimization/paper.html. Your technique will never match this.
To be fair, however, Dataquest’s solution also fails as it says the domain is ftp, when it seems it should be ftp:.