#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?i)(<a([^>]*)>)(<img([^>]*)>)"
Local $sString = "<a href="http://www.mobil.hr/wp-content/uploads/2017/12/Screenshot_20171219-102229.png"><img class="aligncenter wp-image-4054" src="http://www.mobil.hr/wp-content/uploads/2017/12/Screenshot_20171219-102229-563x1000.png" alt="" width="339" height="602" /></a>"
Local $sSubst = "<div>\1 \3</div>"
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