#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)([一-龟]+:)\s*([^\n]*?)\n\s*([^\n]*?)\s*([^\n]*?)\n\s*([^\n]*?)\s*([^\n]*?)\n\s*([^\n]*?)\n"
Local $sString = " 位: {" & @CRLF & _
" default: '左'," & @CRLF & _
" type: String," & @CRLF & _
" }," & @CRLF & _
" 高: {" & @CRLF & _
" default: ''," & @CRLF & _
" type: [String, Number]," & @CRLF & _
" }," & @CRLF & _
" 宽: {" & @CRLF & _
" default: ''," & @CRLF & _
" type: [String, Number]," & @CRLF & _
" }," & @CRLF & _
" 驼高: {" & @CRLF & _
" default: ''," & @CRLF & _
" type: String," & @CRLF & _
" }," & @CRLF & _
" 骆高: {" & @CRLF & _
" default: ''," & @CRLF & _
" type: String," & @CRLF & _
" }," & @CRLF & _
" 样: {" & @CRLF & _
" default: '工 gong'," & @CRLF & _
" type: String," & @CRLF & _
" }," & @CRLF & _
" 料: {" & @CRLF & _
" default: () => {" & @CRLF & _
" return []" & @CRLF & _
" }," & @CRLF & _
" type: Array," & @CRLF & _
" }," & @CRLF & _
" 啥: {" & @CRLF & _
" defaule: () => {" & @CRLF & _
" return {}" & @CRLF & _
" }," & @CRLF & _
" type: Object," & @CRLF & _
" },"
Local $sSubst = "$1$2$3$4$5$6$7\n"
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