#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)[a-zA-Z0-9\-\_]*\.[a-zA-Z0-9\-\_]*\.\w{1,3}(\.\w{1,3})?"
Local $sString = "" & @CRLF & _
"" & @CRLF & _
"service.mensfitness.co.uk" & @CRLF & _
"updates.mensfitness.co.uk" & @CRLF & _
"promo.mensfitness.co.uk" & @CRLF & _
"deals.mensfitness.co.uk" & @CRLF & _
"subs.mensfitness.co.uk" & @CRLF & _
"" & @CRLF & _
"service.healthandfitnessoneline.co.uk" & @CRLF & _
"updates.healthandfitnessoneline.co.uk" & @CRLF & _
"promo.healthandfitnessoneline.co.uk" & @CRLF & _
"deals.healthandfitnessoneline.co.uk" & @CRLF & _
"subs.healthandfitnessoneline.co.uk" & @CRLF & _
"" & @CRLF & _
"service.custompc.co.uk" & @CRLF & _
"updates.custompc.co.uk" & @CRLF & _
"promo.custompc.co.uk" & @CRLF & _
"deals.custompc.co.uk" & @CRLF & _
"subs.custompc.co.uk" & @CRLF & _
"" & @CRLF & _
"service.digitalslrphoto.com" & @CRLF & _
"updates.digitalslrphoto.com" & @CRLF & _
"promo.digitalslrphoto.com" & @CRLF & _
"deals.digitalslrphoto.com" & @CRLF & _
"subs.digitalslrphoto.com" & @CRLF & _
""
Local $sSubst = "'\g<0>'"
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