#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "{[a-z]+:ce_img:(?:single|pair)?([\w\W\s]+)*}"
Local $sString = "{eggs:ce_img:single " & @CRLF & _
" src="{src}"" & @CRLF & _
" fallback_src="/assets/a-b-c.jpg"" & @CRLF & _
" width="250"" & @CRLF & _
" height="250"" & @CRLF & _
" add_dims="no"" & @CRLF & _
" crop="yes"" & @CRLF & _
" title="{title}"" & @CRLF & _
" alt="{title}"" & @CRLF & _
" allow_scale_larger="yes"" & @CRLF & _
"}"
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