#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?i)(?:src|href)=[\'"](?!http|https|//)\K/?([^\'"]*)"
Local $sString = "<img src="/">" & @CRLF & _
"<a href="/contact-us">Contact Us</a>" & @CRLF & _
"<a href="contact-us">Contact Us</a>" & @CRLF & _
"<img src="/datas/users/32-img.jpg" />" & @CRLF & _
"<img src="datas/users/32-img.jpg" />" & @CRLF & _
"" & @CRLF & _
"<a href="Https://abs/url/doc.xml" />RSS</a>" & @CRLF & _
"<a href='http://relative/url/'>Note the Single Quote</a>" & @CRLF & _
"<img src="//site.com/protocol-relative-img.jpg" />" & @CRLF & _
"<img https="https://airlinercafe.com/protocol-relative-img.jpg" />"
Local $sSubst = "https://airlinercafe.com/$1"
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