#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)(https?://\S+)|:[\w+-]+:"
Local $sString = ":smile: :thumbs_up: :+1: :-1:" & @CRLF & _
"but NOT if the colons are part of the url, like this URL for example: http://pdf.reuters.com/htmlnews/htmlnews.asp?i=43059c3bf0e37541&u=urn:newsml:reuters.com:20190417:nPn5XHnXBa" & @CRLF & _
"I was browsing and found this url :smile: http://pdf.reuters.com/htmlnews/htmlnews.asp?i=43059c3bf0e37541&u=urn:newsml:reuters.com:20190417:nPn5XHnXBa it's fantastic :smile::+1: Remember: don't forget to upvote!"
Local $sSubst = "\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