#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)[A-Z]\S*\.[^\S\r\n]+[A-Z]|(?:^|[.!?][\t ]+)([A-Z]\S*)"
Local $sString = "We went to Dr. Smith's office" & @CRLF & _
"" & @CRLF & _
"This is a proper sentence. It is followed by another sentence. What happens when an abbreviation like NASA enters the scene? What about N.A.S.A with the dots in between?" & @CRLF & _
"" & @CRLF & _
"It is NASA! No one will convince me otherwise!" & @CRLF & _
"" & @CRLF & _
"N.A.S.A. at the start of a sentence? N.A.S.A. immediately after?" & @CRLF & _
"At the end of the sentence: NASA. But also with the dots: N.A.S.A. Filler sentence here." & @CRLF & _
"" & @CRLF & _
"The compromise of catching situations like Dr. Smith is that words at the end of a sentence cannot start with a capital letter." & @CRLF & _
"" & @CRLF & _
"While This Regex Doesn't Match Every Word As The Start Of A Sentence Here, It Won't Detect The Start Of The Next Sentence. Case in point." & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"Abbreviations like LIKE currently pose a problem." & @CRLF & _
"" & @CRLF & _
"The second regex has false negatives: it will fail to match `So` in `This is sentence is English. So is this one.`" & @CRLF & _
""
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYGLOBALFULLMATCH)
Local $aFullArray[0]
For $i = 0 To UBound($aArray) -1
_ArrayConcatenate($aFullArray, $aArray[$i])
Next
$aArray = $aFullArray
; Present the entire match result
_ArrayDisplay($aArray, "Result")
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for AutoIt, please visit: https://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm