#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)(<text xml:lang=")en">(.+?)(</text>)\R \1es">\3\R \1fr">\3\R \1de">\3\R \1pt">\3\R \1du">\3"
Local $sString = " <text xml:lang="en">"Insert Swab to Start Analysis"</text>" & @CRLF & _
" <text xml:lang="es"></text>" & @CRLF & _
" <text xml:lang="fr"></text>" & @CRLF & _
" <text xml:lang="de"></text>" & @CRLF & _
" <text xml:lang="pt"></text>" & @CRLF & _
" <text xml:lang="du"></text>"
Local $sSubst = "<en>\2</en>\r\n <es>\2</es>\r\n <fr>\2</fr>\r\n <de>\2</de>\r\n <pt>\2</pt>\r\n <du>\2</du>"
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