0
這是我的代碼有:如何在第一個索引號之前打印文本?
>>> text= """ this is an example Item 2 text text <B>Item 2. example"""
>>> a=re.search ('(?<=<B>)Item 2\.',text)
>>> b = a.span()
>>> print (b)
(45, 57)
>>>
我怎麼能打印所有(前45)的第一個索引號之前出現的文本?