#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?i)([0-9]GB|GB)[!@#$%^&*() _,.:]\w+ (?:\w+\s+){1,3}application"
Local $sString = "Gb:2 existing application While comparing with iPhone and Samsung " & @CRLF & _
"application we can easily say that iPhone has some extra application and features. " & @CRLF & _
"But most of the application in iPhone are now available in Samsung also." & @CRLF & _
"Please look at the below comparison.Gb,8 with application Apple iPhone " & @CRLF & _
"8Gb with extra application and features Apple iPhone 4Gb with extra application" & @CRLF & _
"and features Samsung Gb-2s with extra application and features Samsung " & @CRLF & _
"2Gb with extra application and features"
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