#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)$(?<!_1[6-9]|_2[0-4])"
Local $sString = "x2016_17_7" & @CRLF & _
"x2017_188" & @CRLF & _
"x2018_199" & @CRLF & _
"x2019_20_10" & @CRLF & _
"x2020_21_11" & @CRLF & _
"x2021_22_12" & @CRLF & _
"x2022_23_13" & @CRLF & _
"x2023_20_10" & @CRLF & _
"x202025_15" & @CRLF & _
"x2016_17_16" & @CRLF & _
"x2017_18_17" & @CRLF & _
"x2018_19_18" & @CRLF & _
"x2019_20_19" & @CRLF & _
"x2020_21_20" & @CRLF & _
"x2021_22_21" & @CRLF & _
"x2022_23_22" & @CRLF & _
"x2023_20_23" & @CRLF & _
"x2020_25_20"
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