I have a list of URLs in formats such as "www.blah.com/en-us" and I need to cut-off anything after the "www.blah.com". I've tried using the following:
import re
website = www.blah.com/en-us
cleanURL = re.sub('(.|\n)*?com', "", website)
Output: 'en-us'
So I'm getting the opposite of what I want. Sorry if this post isn't correctly formatted, first time asking a question.