Extract name between a word and comma from text with regex

前端 未结 1 868
无人共我
无人共我 2021-01-28 18:14

I have a thousands .txt files with a large text. I want to extract some information from these files, like some names, numbers and dates. There are fields that follow a pattern

1条回答
  •  清酒与你
    2021-01-28 18:55

    Use the pattern ([^,]*) to match everything upto a comma

    >>> re.findall(r'\sante mí:\s+([^,]*)', mensaje)
    ['DANIEL ROLANDO  CORNEJO GALLARDO']
    

    0 讨论(0)
提交回复
热议问题