我有以下字串:
"This is a question? This is an answer This is another question? This is another answer."
我想要做的是創建一個匹配所有問題的正則運算式,以便我可以洗掉它們。在這種情況下,前面的答案或句子并不總是以“。”結尾。(句號)。所以我正在尋找的是匹配以問號結尾并以大寫字母開頭的句子。
我想匹配的內容:
"This is a question?" and "This is another question?"
我在 R 中作業,所以我更喜歡 stringr 的答案,但我最感興趣的是我應該應用的正則運算式。
uj5u.com熱心網友回復:
這應該在正則運算式中起作用: ([A-Z][^A-Z?]*\?)
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/348223.html
