#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?s)\-\-\sSTART\n(.+?)\n\-\-\sEND"
Local $sString = "-- START" & @CRLF & _
"CREATE DATABASE IF NOT EXISTS feather_store_dev;" & @CRLF & _
"-- END" & @CRLF & _
"" & @CRLF & _
"-- START" & @CRLF & _
"CREATE TABLE IF NOT EXISTS feather_store_dev.accounts (" & @CRLF & _
" id int," & @CRLF & _
" email varchar(25)," & @CRLF & _
" bio varchar(18)," & @CRLF & _
" password varchar(32)," & @CRLF & _
" PRIMARY KEY (id)" & @CRLF & _
");" & @CRLF & _
"-- END"
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