Improving on lonemc's answer (which improved on Mia Chen's answer, which improved on mircealungu's answer):
First, we can stick a u
option at the end in order to match unicode characters. In other words, we probably want to be able to parse German sentences, French sentences, etc.
Second, instead of hard-coding the characters that should end a sentence, we can use "Sentence_Terminal", which is part of the unicode standard.
Third, instead of hard-coding the characters that make up a closing bracket, we can use "Close_Punctuation".
Forth, instead of hard-coding the characters that make up a closing quote, we can use "Final_Punctuation".
Fifth, we might not want to match things that look like enums. For example:
This is the first sentence! This is the second sentence with MyEnum.Value1 where I talk about it!
In order to do that, we can compose a match using a lookahead pattern:
string.match(/(?=[^])(?:\P{Sentence_Terminal}|\p{Sentence_Terminal}(?!['"`\p{Close_Punctuation}\p{Final_Punctuation}\s]))*(?:\p{Sentence_Terminal}+['"`\p{Close_Punctuation}\p{Final_Punctuation}]*|$)/guy);
Here's a link to the regex on Regex101.com.