我想剪下匹配的线。你知道吗
我考虑使用“[m.start()”表示m in重新查找('')“获取索引。你知道吗
但我认为存在的方式比这更好。你知道吗
例如,我想在“header”和“footer”之间剪切字符串。你知道吗
str = "header1svdijfooter1ccsdheader2cdijhfooter2"
headers = ["one": "header1", "two": "header2"]
footers = ["one": "footer1", "two": "footer2"]
#I want to get ["header1svdijfooter1", "header2cdijhfooter2"]
请告诉我。你知道吗
或者:
无re:
输出:
相关问题 更多 >
编程相关推荐