import re str=\"x8f8dL:s://www.qqq.zzz/iziv8ds8f8.dafidsao.dsfsi\" str2=re.match(\"[a-zA-Z]*//([a-zA-Z]*)\",str) print str2.group() current result=> error expec
output=re.findall("(?<=//)\w+.*(?=/)",str) final=re.sub(r"[^a-zA-Z0-9]+", "", output [0]) print final