#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^.*(?=\nOUTRAS INFORMAÇÕES)"
Local $sString = "NOME: TESTE DE SILVA SAURO" & @CRLF & _
"CPF: 785.981.970-84" & @CRLF & _
"DECLARAÇÃO DE AJUSTE ANUAL" & @CRLF & _
"IMPOSTO SOBRE A RENDA - PESSOA FÍSICA" & @CRLF & _
"EXERCICIO 2018 ANO-CALENDÁRIO 2017" & @CRLF & _
"EVOLUÇÃO PATRIMONIAL" & @CRLF & _
"Bens e direitos em 31/12/2016" & @CRLF & _
"Bens e direitos em 31/12/2017" & @CRLF & _
"Dividas conus rcais em 31/12/2016" & @CRLF & _
"Divisas e ônus reais em 31/12/2017" & @CRLF & _
"100.580.873.91" & @CRLF & _
"100.329. 110,32" & @CRLF & _
"9135,456,07" & @CRLF & _
"8.571.962,06" & @CRLF & _
"OUTRAS INFORMAÇÕES" & @CRLF & _
"Rendimentos isentos e não tributáveis"
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