#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)(?<!href="|">)(https?:\/\/[\w\-\.!~?&=+\*\'(),\/]+)((?!\<\/\a\>).)*"
Local $sString = "Test," & @CRLF & _
"" & @CRLF & _
"Here\'s an interesting in-house litigation position with JPMorgan Chase in New York I thought you might be interested inL" & @CRLF & _
"" & @CRLF & _
"<a href="http://www.xxx.com/lcdetail.php?akey=e1725">http://www.xxx.com/lcdetail.php?akey=e1725</a>" & @CRLF & _
"" & @CRLF & _
"They are not using recruiters to fill this job, so if you are interested you can just apply directly. " & @CRLF & _
"" & @CRLF & _
"http://www.xxx.com/lcdetail.php?akey=e1725" & @CRLF & _
"" & @CRLF & _
"Cordially" & @CRLF & _
"--Harrison"
Local $sSubst = "<a href="$1">$1</a>"
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