#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^(`{3}.*[\n\r][^]*?^`{3})"
Local $sString = "Find: `^(.*)`" & @CRLF & _
"Replace: `Prefix-\1`" & @CRLF & _
"" & @CRLF & _
"```" & @CRLF & _
"1" & @CRLF & _
"2" & @CRLF & _
"3" & @CRLF & _
"```" & @CRLF & _
"" & @CRLF & _
"Into:" & @CRLF & _
"" & @CRLF & _
"```" & @CRLF & _
"Prefix-1" & @CRLF & _
"Prefix-2" & @CRLF & _
"Prefix-3" & @CRLF & _
"```" & @CRLF & _
"" & @CRLF & _
"Thanks. That’s handy, but I’m not likely to remember it (regex not my thing), whereas an action can be named and easily run." & @CRLF & _
"" & @CRLF & _
"I’ve been thinking about this for while. It’s similar to other Drafts actions I’ve written, so I took some of that code and built [this](https://actions.getdrafts.com/a/17N)."
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYGLOBALFULLMATCH)
Local $aFullArray[0]
For $i = 0 To UBound($aArray) -1
_ArrayConcatenate($aFullArray, $aArray[$i])
Next
$aArray = $aFullArray
; Present the entire match result
_ArrayDisplay($aArray, "Result")
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