#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?im)(?<=\b(create|alter|drop)\s+(procedure|proc|table|trigger|view|function)\b\s\[dbo\].)\[.*?\]"
Local $sString = "this is a test... bonjour les mecs." & @CRLF & _
"coucou2" & @CRLF & _
"" & @CRLF & _
"Est-ce que ça va bien par chez vous?" & @CRLF & _
"ben oui." & @CRLF & _
"<B>ici c'est pepsi</B> test" & @CRLF & _
"ALTER PROCEDURE test" & @CRLF & _
"(" & @CRLF & _
"merveilleux" & @CRLF & _
")" & @CRLF & _
"" & @CRLF & _
"fini" & @CRLF & _
"" & @CRLF & _
"CREATE PROC dbo.[test2]" & @CRLF & _
"" & @CRLF & _
"encore fini..."
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYFULLMATCH)
; 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