Python正则表达式匹配一段英文中包含关键字的句子
1.问题/需求
在含有多行文字的英文段落或一篇英文中查找匹配含有关键字的句子。
例如在以下字符串:
text = """Today I registered my personal blog in the cnblogs and wrote my first essay. The main problem of this essay is to use python regular expression matching to filter out sentences containing keywords in the paper. To solve this problem, I made many attempts and finally found a regular expression matching method that could meet the requirements through testing. So I"ve documented the problem and the solution in this blog post and shared it for reference to others who are having the same problem. At the same time, this text is also used to test the feasibility of this matching approach. Some additional related thoughts and ideas will be added to this blog later."""