I'm quite new to python. I'm trying to parse a file of URLs to leave only a specific part (bold part) of URL.
Here are some example of URL's i am working with:
http://www.mega.pk/**washingmachine**-dawlance/
http://www.mega.pk/**washingmachine**-haier/
http://www.mega.pk/**airconditioners**-acson/
http://www.mega.pk/**airconditioners**-lg/
http://www.mega.pk/**airconditioners**-samsung/
I have tried some regular expression but it gets very complicated. What I have in mind is remove this "http://www.mega.pk/" from all urls as it is common and then remove anything that is after "-" including all slashes. But know no way of doing it.