I want to extract any string after 'user=' from the string '/?user=hello&user=man&user='. In this case that would get me 'hello', 'man' and ''.
I’m stuck here:
>>> import re
>>> s = '/?user=hello&user=man&user='
>>> re.findall("user=(.*)",s)
['hello&user=man&user=']
I would be able to find what I want if the last occurence of user= also ended with &, but does anybody know how to find ['hello', 'man', ''] in this string?
I would drop the
reand use the tools meant for this: