我需要一个 JavaScript 中的 RegExp 来匹配除每个句子的第一个单词之外的所有内容。例如:
This is a super cool sentence. Immediately following is this sentence. Super cool story bro.
我需要的是:
**** is a super cool sentence. *********** following is this sentence. ***** cool story bro.
我有这个,这与我需要的完全相反(匹配每个句子的第一个单词):
(?:^|(?:[.!?]\s))(\w+)
谁能帮我反转这个正则表达式,这样我就可以得到除了每个句子的第一个单词之外的所有内容?
最佳答案
这个正则表达式将返回一个句子数组,每个句子没有第一个单词:
/\s*\w*\s*([\w\s,;'\"]+[.?!])/gi
关于javascript - 除了句子的第一个单词之外的每个单词的 RegExp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27335617/