#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)^([^\d\n]+(?:\d+[^\d\n]*)?)(?: |$)(?:(\d+|SN\b) *([^\d\n]+\d+))?$"
Local $sString = "AV 12 DE SETEMBRO 25 BLOCO 02" & @CRLF & _
"RUA JOSE ANTONIO 132 CS 05" & @CRLF & _
"AV CAXIAS 02 CASA 03" & @CRLF & _
"AV 11 DE NOVEMBRO 2032 CASA 4" & @CRLF & _
"RUA 05 DE OUTUBRO 25 CASA 02" & @CRLF & _
"RUA 15" & @CRLF & _
"AVENIDA 3 PODERES"
Local $sSubst = "no_logradouro:$1, nu_logradouro:$2, complemento:$3\n"
Local $sResult = StringRegExpReplace($sString, $sRegex, $sSubst)
MsgBox($MB_SYSTEMMODAL, "Result", $sResult)
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