Regex newbie here. I have a bunch of URLs from which I need to extract some substrings for which I am using regular expression.
Ex: If my URL is https://chrome.google.com/webstore/detail/vt-hokie-stone-theme/enmbbbhbkojhbkbolmfgbmlcgpkjjlja?hl=en-US, I need to extract 1. vt-hokie-stone-theme part and 2. enmbbbhbkojhbkbolmfgbmlcgpkjjlja part from this url into two seperate variables.
The initial part of my URL always remains constant, so I built the following regular expression detail\/([a-z0-9\-]+)\/([a-z]+) and I am trying to mach on http://www.pythonregex.com/
I see that regex.findall(string) gives me what I want but I have following questions:
I want them in two seperate variables, instead of having them as a list format in a single variable. How do I do it?
Also, while checking on pythonregex, the
regex.findall(string)command gives the output as[(u'vt-hokie-stone-theme', u'enmbbbhbkojhbkbolmfgbmlcgpkjjlja')]. I understand that the precedingumeans unicode but I don't want it in my output. How do I remove it?