#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?x)(?:\G(?!\A)|<img)" & @CRLF & _
"(?s:.+?\bsrc=['"])\K" & @CRLF & _
"https?://.+?(?=/wp-content/)"
Local $sString = "<img " & @CRLF & _
"src="https://www.example.com/de/wp-content/uploads/sites/1/2017/03/image.jpg"" & @CRLF & _
"data-srcset="" & @CRLF & _
" https://www.example.com/de/wp-content/uploads/sites/1/2017/03/img1.jpg 507w," & @CRLF & _
" https://www.example.com/de/wp-content/uploads/sites/1/2017/03/img2.jpg 780w," & @CRLF & _
" https://www.example.com/de/wp-content/uploads/sites/74/2017/03/img3.jpg 950w"" & @CRLF & _
"data-sizes="" & @CRLF & _
" (min-width: 80em) calc(0.5 * (100vw - (100vw- 57em)))," & @CRLF & _
" (min-width: 48em) calc(0.5 * (100vw - 5em))," & @CRLF & _
" calc(100vw - 1em)"" & @CRLF & _
"alt="image" class="lazyload">" & @CRLF & _
"" & @CRLF & _
"<img " & @CRLF & _
"src="https://www.example.com/de/wp-content/uploads/sites/1/2017/03/image.jpg"" & @CRLF & _
"data-srcset="" & @CRLF & _
" https://www.example.com/de/wp-content/uploads/sites/1/2017/03/img1.jpg 507w," & @CRLF & _
" https://www.example.com/de/wp-content/uploads/sites/1/2017/03/img2.jpg 780w," & @CRLF & _
" https://www.example.com/de/wp-content/uploads/sites/74/2017/03/img3.jpg 950w"" & @CRLF & _
"data-sizes="" & @CRLF & _
" (min-width: 80em) calc(0.5 * (100vw - (100vw- 57em)))," & @CRLF & _
" (min-width: 48em) calc(0.5 * (100vw - 5em))," & @CRLF & _
" calc(100vw - 1em)"" & @CRLF & _
"alt="image" class="lazyload">"
Local $sSubst = "http://someotherdomain.com"
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