I used regular expressions to get a string from a web page and part of the string may contain something I would like to replace with something else. How would it be possible to do this? My code is this, for example:
stuff = "Big and small"
if stuff.find(" and ") == -1:
# make stuff "Big/small"
else:
stuff = stuff
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…