#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)^((?!(\?)|(\[))(.+(\n|$)))+"
Local $sString = "this is paragraph line1 line 1" & @CRLF & _
"and line 2" & @CRLF & _
"" & @CRLF & _
"?[question_2]{"category":[]}[who are you]=[] {1,2}" & @CRLF & _
"[] OPTION 1" & @CRLF & _
"[] OPTION 2" & @CRLF & _
"[] OPTION 3" & @CRLF & _
"" & @CRLF & _
"this is paragraph line3" & @CRLF & _
"with a line break" & @CRLF & _
"" & @CRLF & _
"?[question_3]{"category":[]}[picode]=_ [PLACEHOLDER_TEXT]" & @CRLF & _
"" & @CRLF & _
"?[question_1]{"category":[]}[sex]=() {1}" & @CRLF & _
"() male " & @CRLF & _
"() femele " & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"this is paragraph line3" & @CRLF & _
"in the end of file"
Local $sSubst = ""
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