#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)[0-9A-Z][0-9A-Za-z,;:'"\* ]*[.!?;:]"
Local $sString = "This is an english sentence tokenizer; it tokenizes correct english sentences." & @CRLF & _
"This can be done in a very short, "regex" string." & @CRLF & _
"" & @CRLF & _
"Incorrect sentence examples be like:" & @CRLF & _
"" & @CRLF & _
"awesome thats so cool!" & @CRLF & _
"" & @CRLF & _
"The text states, "Super!"." & @CRLF & _
"" & @CRLF & _
"sys.exit()" & @CRLF & _
"" & @CRLF & _
"(parenthesis)" & @CRLF & _
"" & @CRLF & _
"New headlines!?!?!?" & @CRLF & _
"" & @CRLF & _
"I want ice cream and/or pizza." & @CRLF & _
"" & @CRLF & _
"Correct sentence examples be like:" & @CRLF & _
"" & @CRLF & _
"Awesome, that's so cool!" & @CRLF & _
"" & @CRLF & _
"The text states, "Super"!" & @CRLF & _
"" & @CRLF & _
"0x000F;" & @CRLF & _
"" & @CRLF & _
"S's's's's." & @CRLF & _
"" & @CRLF & _
"New headlines!" & @CRLF & _
"" & @CRLF & _
"I want ice cream and or pizza." & @CRLF & _
"" & @CRLF & _
"I hate regex's "catastrophic backtracking" it's literally fake."
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