#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?mx)^(\d*0)\..*\n(?!\d*1\.|(?!\d))|" & @CRLF & _
"^(\d*1)\..*\n(?!\d*2\.|(?!\d))|" & @CRLF & _
"^(\d*2)\..*\n(?!\d*3\.|(?!\d))|" & @CRLF & _
"^(\d*3)\..*\n(?!\d*4\.|(?!\d))|" & @CRLF & _
"^(\d*4)\..*\n(?!\d*5\.|(?!\d))|" & @CRLF & _
"^(\d*5)\..*\n(?!\d*6\.|(?!\d))|" & @CRLF & _
"^(\d*6)\..*\n(?!\d*7\.|(?!\d))|" & @CRLF & _
"^(\d*7)\..*\n(?!\d*8\.|(?!\d))|" & @CRLF & _
"^(\d*8)\..*\n(?!\d*9\.|(?!\d))|" & @CRLF & _
"^(\d*9)\..*\n(?!\d*0\.|(?!\d))"
Local $sString = "1. And this is line one" & @CRLF & _
"2. So this is line two" & @CRLF & _
"4. I think I missed something here..." & @CRLF & _
"5. Carrying on." & @CRLF & _
"6. Feeling cozy again." & @CRLF & _
"8. Wait, I missed something again." & @CRLF & _
"10. I just missed more somethings again." & @CRLF & _
"13. Dude, what's happening?" & @CRLF & _
"14. Things are alright again." & @CRLF & _
"15. Still good." & @CRLF & _
"17. Whoops, bubble." & @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