如何使用 regex 和 stringr 从文本中删除所有问题?

How do I remove all questions from a text with regex and stringr?

编辑以证明我自己努力解决了这个问题

我有以下字符串:

"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 的答案,但我最感兴趣的是我应该应用的正则表达式。

我尝试了以下正则表达式 ^[A-Z].+\? 但不幸的是它匹配了整个字符串。

这应该在正则表达式中起作用:([A-Z][^A-Z?]*\?)