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
expected => wwwqqqzzz
I want to extract the string wwwqqqzzz
. How I do that?
Maybe there are a lot of dots, such as:
"whatever..s#$@.d.:af//wwww.xxx.yn.zsdfsd.asfds.f.ds.fsd.whatever/123.dfiid"
In this case, I basically want the stuff bounded by //
and /
. How do I achieve that?
One additional question:
import re
str="xxx.yyy.xxx:80"
m = re.search(r"([^:]*)", str)
str2=m.group(0)
print str2
str2=m.group(1)
print str2
Seems that m.group(0)
and m.group(1)
are the same.