#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "https?://\Qeem.mydomain.com\E/\K\d{4}/\d{2}/([^"'>]*?)\.html"
Local $sString = "Hello there how are <a " & @CRLF & _
"href="http://eem.mydomain.com/2015/06/court-compels-epa-to-" & @CRLF & _
"respond.html">some link name</a> there how are there how are " & @CRLF & _
"<a href="http://eem.mydomain.com/2014/03/wv-clean-air-act-case.html">another " & @CRLF & _
"link name</a>"
Local $sSubst = "energy-environment-blog/$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