如何使用正则表达式在Python中查找定义?

如何使用正则表达式在Python中查找定义?,python,definition,Python,Definition,这是我的教授给我们的线索: text = '''I make my own cheese. Cheese is a dairy product, derived from milk and produced in wide ranges of flavors, textures and forms by coagulation of the milk protein casein. I personally really love cheese. Casein: a family of rela

这是我的教授给我们的线索:

text = '''I make my own cheese. Cheese is a dairy product, derived from milk and produced in wide ranges of flavors, textures and forms by coagulation of the milk protein casein. I personally really love cheese. Casein: a family of related phosphoproteins. These proteins are commonly found in mammalian milk'''

for r in re.finditer('\w+',text):  #Here, I would split my text into sentences
    word = r.group(0)
    if re.search(r'lly\b',word): #Here, I would identify a type of sentence
        print(word)
    if re.search(r'tion\b',word):   #Here, I would identify another type of sentence
        print(word)

基本上,我从自己的文本中收集的是两种类型的定义;一个是整合到句子中的词,后面通常跟一个描述性动词(“奶酪是…”),另一个是定义词,后面跟一个冒号及其定义(发明词?)句子(“酪蛋白:[…])。我花了整整一个星期的时间绞尽脑汁,试图找到一种方法,在没有任何运气的情况下提取和打印这些句子。作为一名语言学专业的学生,如果你能提供任何帮助,我将不胜感激。谢谢。

有什么问题吗?有错误吗?问题是我不知道如何使用正则表达式从文本中提取这两句话:“奶酪是乳制品[…]”和“酪蛋白:一个[…]家族”。