#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?i)UPDATE[ \t\n]{1,}(fact)(.*)\n(from)?([ \t\n]{1,})?(.*)?\n*set[ \n\t]{1,}(coloana)[ \t\n]*=[ \t\n]*(ifnull\(\s*)*([\w\d]*)([\ ,'\w\n\t)(\n=.]*);"
Local $sString = "update fact,x2,asdasjsdjbmfeweoewo" & @CRLF & _
"from asdas,asaskdvd" & @CRLF & _
"set coloana = ifnull( ifnull( col2,'Test'), 'Test2')" & @CRLF & _
"where c = c.s." & @CRLF & _
"and asdsa = asda.asda;" & @CRLF & _
"" & @CRLF & _
"UPdate fact,x2" & @CRLF & _
"set coloana = ifnull(col2,'Test')" & @CRLF & _
"where c = c.s.;" & @CRLF & _
"" & @CRLF & _
"update" & @CRLF & _
" fact,x2" & @CRLF & _
"from" & @CRLF & _
" asdas" & @CRLF & _
"set coloana = ifnull(col2,'Test')" & @CRLF & _
"where c = c.s." & @CRLF & _
"and asdsa = asda.asda;" & @CRLF & _
"" & @CRLF & _
"update fact,x2" & @CRLF & _
"from asdas" & @CRLF & _
"set coloana = (select x from y where x.fg = x2.asfds)" & @CRLF & _
"where c = c.s." & @CRLF & _
"and asdsa = asda.asda;"
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYFULLMATCH)
; 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