Regular expression to extract whole sentences with matching word

前端 未结 4 929
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-03 06:20

I would like to extract sentences with the word \"flung\" in the whole text.

For example, in the following text, I\'d like to extract the sentence \"It was exactly

4条回答
  •  星月不相逢
    2020-12-03 06:37

    Simply anything between dots:

    without a dote

    [A-Za-z," ]+word[A-Za-z," ]+
    

    with a dote

    [A-Za-z," ]+word[A-Za-z," ]+\.
    

提交回复
热议问题