#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)iPhone [6-7]"
Local $sString = "iPhone 7 Plus" & @CRLF & _
"iPad Pro 12.9 2015 iOS15.5 beta 4" & @CRLF & _
"iPhone 11 Pro iOS15.5 beta4" & @CRLF & _
"iPad Pro 10.5 2017" & @CRLF & _
"iPad 9.7 2018 iOS15.5 beta4" & @CRLF & _
"iPhone X " & @CRLF & _
"iPhone 11 Pro Max" & @CRLF & _
"iPad Pro 10.5 2017" & @CRLF & _
"iPad mini 3" & @CRLF & _
"iPhone X" & @CRLF & _
"iPad Pro 12.9 2021" & @CRLF & _
"iPhone 13" & @CRLF & _
"iPhone 11" & @CRLF & _
"iPhone 12 mini" & @CRLF & _
"iPad Pro 12.9 2018" & @CRLF & _
"iPad Pro 11 2018" & @CRLF & _
"iPhone 12" & @CRLF & _
"iPhone X iOS15.5 beta4" & @CRLF & _
"iPad Air 2" & @CRLF & _
"iPhone 8" & @CRLF & _
"iPhone 6" & @CRLF & _
"iPhone XS Max" & @CRLF & _
"iPad mini 4" & @CRLF & _
"iPad Air 3 (2019)" & @CRLF & _
"iPhone SE 2020" & @CRLF & _
"iPhone 11 Pro" & @CRLF & _
"iPhone 12 Pro" & @CRLF & _
"iPad Mini 2019" & @CRLF & _
"iPad 9.7 2018" & @CRLF & _
"iPad 10.2 2020" & @CRLF & _
"iPhone SE" & @CRLF & _
"iPad Air 2" & @CRLF & _
"iPad Air 2022 5th Gen" & @CRLF & _
"iPad Air 2020" & @CRLF & _
"iPad Air 2" & @CRLF & _
"iPad Pro 11 2021" & @CRLF & _
"iPhone SE 2020" & @CRLF & _
"iPhone 6 Plus" & @CRLF & _
"iPad Pro 11 2020" & @CRLF & _
"iPad 10.2 2020" & @CRLF & _
"iPad Pro 10.5 2017" & @CRLF & _
"iPad 10.2" & @CRLF & _
"iPhone XR" & @CRLF & _
"iPad Pro 12.9 2015" & @CRLF & _
"iPad Pro" & @CRLF & _
"iPad Air 2" & @CRLF & _
"iPhone 7" & @CRLF & _
"iPad Mini 2021 6th Gen" & @CRLF & _
"iPad Air 2020" & @CRLF & _
"iPhone 8 Plus" & @CRLF & _
"iPhone 11" & @CRLF & _
"iPad 9.7 2017 5th Gen" & @CRLF & _
"iPhone XS" & @CRLF & _
"iPad Pro 12.9 2020" & @CRLF & _
"iPhone 6S" & @CRLF & _
"iPad Air" & @CRLF & _
"iPhone XS Max" & @CRLF & _
"iPhone SE 2020" & @CRLF & _
"iPhone_11_Pro" & @CRLF & _
"iPhone 5S" & @CRLF & _
"iPhone 8" & @CRLF & _
"iPhone 7 Plus" & @CRLF & _
"iPod Touch 6" & @CRLF & _
"iPad Pro 9.7" & @CRLF & _
"iPhone 12 mini iOS15.5 beta4" & @CRLF & _
"iPhone X" & @CRLF & _
"iPhone 8" & @CRLF & _
"iPhone 6" & @CRLF & _
"iPhone X" & @CRLF & _
"iPhone 13 Pro Max" & @CRLF & _
"iPhone 12 Pro Max" & @CRLF & _
"iPad Air 2 iOS15.5 beta4" & @CRLF & _
"iPhone 6" & @CRLF & _
"iPad mini 4" & @CRLF & _
"iPad Pro 11 2018" & @CRLF & _
"iPad Pro 12.9 2015" & @CRLF & _
"iPhone XR" & @CRLF & _
"iPhone XS" & @CRLF & _
"iPhone XR" & @CRLF & _
"iPhone 7" & @CRLF & _
"iPad Pro 12.9 2017" & @CRLF & _
"iPhone 8" & @CRLF & _
"iPhone 6S" & @CRLF & _
"iPad Pro 12.9 2017" & @CRLF & _
"iPad Pro 12.9" & @CRLF & _
"iPhone X " & @CRLF & _
"iPhone 8 Plus" & @CRLF & _
"iPad Air 3 (2019)" & @CRLF & _
"iPhone 8" & @CRLF & _
"iPhone 12 Pro Max" & @CRLF & _
"iPad Pro 12.9 2015" & @CRLF & _
"iPad mini 4" & @CRLF & _
"iPhone 13 mini" & @CRLF & _
"iPad Air 2" & @CRLF & _
"iPhone 13 Pro" & @CRLF & _
"iPhone 7" & @CRLF & _
"iPhone XS" & @CRLF & _
"iPad 10.2 2021 9th Gen" & @CRLF & _
"iPhone SE 2020" & @CRLF & _
"iPod Touch 7" & @CRLF & _
"iPad Air 2" & @CRLF & _
"iPhone 7 Plus" & @CRLF & _
"iPhone SE 2022" & @CRLF & _
"iPhone 6S Plus" & @CRLF & _
"iPhone 12"
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