本文共 253 字,大约阅读时间需要 1 分钟。
import rere.search("pattern(?!.*pattern)", "target_text")
or
import rere.findall("pattern", "target_text")[-1]
import reString = "This is an example sentence, it is for demonstration only"print (re.search("is(?!.*is)", String).start())
it will output 32
转载地址:http://pjxdi.baihongyu.com/