做乜會學返 今次學會唔會又學學下放棄
其實最好搵frd一齊學 互相鼓勵
import re
print (re.sub(r"\s+", " ", list2[0]))
# Jason 4B KB123 9999 US 150 113 6 Paul
["Jason", "4B", "KB", "123"...]
? 同埋KB123係咪唯一既exceptional case?re.split
:import re
print (re.split(r"\s+|(?<=KB)", list2[0].strip()))
['Jason', '4B', 'KB', '123', '9999', 'US', '150', '113', '6', 'Paul']