#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)((AND|OR|NOT)( ))?([a-z_A-Z0-9]*):("\w+.*"|\w+(:?\w+))"
Local $sString = "homo sapiens AND curationstatus:"Manually curated" AND modellingapproach:"Ordinary differential equation model"" & @CRLF & _
"" & @CRLF & _
"test AND UNIPROT:23456 AND metabolism AND heart AND TAXONOMY:40674 AND curation:"Non curated" AND GO:GO:34212 AND publication:23444 AND modellingapproach:"logical model" AND cancer" & @CRLF & _
"" & @CRLF & _
"modelformat:"SBML" AND modelformat:"SBML" AND modellingapproach:"Ordinary differential equation model" AND TAXONOMY:9606" & @CRLF & _
"" & @CRLF & _
"*:* AND modelformat:"SBML" AND modellingapproach:"Ordinary differential equation model" AND TAXONOMY:9606 AND TAXONOMY:10090" & @CRLF & _
"" & @CRLF & _
"*:* AND disease:"Lung Adenocarcinoma" AND cancer AND tumor"
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