我有以下数据:
Barium swallow : There is slow transit to the stomach.
There is lots of other stuff going on.
There is no aspiration.
Conclusion: Appearances are consistent with achalasia.
Barium swallow : There is slow transit to the stomach.
There is no evidence of achalasia here.
There is no aspiration.
Conclusion: Normal study
Barium swallow : There is slow transit to the stomach.
There is no reflux.
There is no aspiration.
Conclusion: Possible achalasia
我想摆脱'no' and achalasia
之间的话,但仅限于一行,以便通过上面的例子我得到
Barium swallow : There is slow transit to the stomach.
There is lots of other stuff going on.
There is no aspiration.
Conclusion: Appearances are consistent with achalasia.
Barium swallow : There is slow transit to the stomach.
There is.
There is no aspiration.
Conclusion: Normal study
Barium swallow : There is slow transit to the stomach.
There is no reflux.
There is no aspiration.
Conclusion: Possible achalasia
要做到这一点(在R中)我使用以下正则表达式:
[Nn]o.*[Aa]chalasia.*?(\\.\\n|\\.$)
然而,我得到了:
Barium swallow : There is slow transit to the stomach.
There is lots of other stuff going on.
There is no
Barium swallow : There is slow transit to the stomach.
There is no aspiration.
Conclusion: Normal study
Barium swallow : There is slow transit to the stomach.
There is no reflux.
There is no
答案 0 :(得分:0)
好的,所以我想出来了。这个问题不是正则表达式,而是当使用带有R的gsub表示正则表达式时,你使用选项perl = T
然后我使用了[Nn]o.*[Aa]chalasia.*?(\\.|$)
做了诀窍