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)的第一个索引号之前出现的文本?