我想使用正则表达式匹配以
例如:"Do not match this. This sentence ends in the last word..."
匹配结果应该是
这个应该不被匹配:"Do not match this. This sentence ends in the last word."
...
结尾的字符串中的最后一个单词,匹配结果应为 ...
前面的单词。例如:"Do not match this. This sentence ends in the last word..."
匹配结果应该是
word
。这个正则表达式有点接近: \b\s+([^.]*)
。但是,我不知道如何让它只匹配在结尾处的 ...
。这个应该不被匹配:"Do not match this. This sentence ends in the last word."