#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)\s*\[\s*\[\s*\[\s*([+-]?\d+(\.\d*)?([EeDd][+-]?\d+)?)\s*,\s*([+-]?\d+(\.\d*)?([EeDd][+-]?\d+)?)\s*\]\s*,\s*\[\s*([+-]?\d+(\.\d*)?([EeDd][+-]?\d+)?)\s*,\s*([+-]?\d+(\.\d*)?([EeDd][+-]?\d+)?)\s*\]\s*,\s*\[\s*([+-]?\d+(\.\d*)?([EeDd][+-]?\d+)?)\s*,\s*([+-]?\d+(\.\d*)?([EeDd][+-]?\d+)?)\s*\]\s*\]\s*\]\s*"
Local $sString = "[[[5,3],[2,8],[6,-3]]]" & @CRLF & _
"" & @CRLF & _
"[ [ [ 5.23 , 3.42 ] , [ 2. , 8.17 ] , [ 6 , -3 ] ] ] " & @CRLF & _
"" & @CRLF & _
"[[" & @CRLF & _
" [ 5, 3]," & @CRLF & _
" [ 2, 8.43]," & @CRLF & _
" [ -6.18,-3]" & @CRLF & _
"]]" & @CRLF & _
"" & @CRLF & _
"[" & @CRLF & _
" [" & @CRLF & _
" [" & @CRLF & _
" 5," & @CRLF & _
" 3.141592653" & @CRLF & _
" ]," & @CRLF & _
" [" & @CRLF & _
" 2.718281828," & @CRLF & _
" 8" & @CRLF & _
" ]," & @CRLF & _
" [ 0.618," & @CRLF & _
" -35.16e-17" & @CRLF & _
" ]" & @CRLF & _
" ]" & @CRLF & _
"]" & @CRLF & _
"" & @CRLF & _
""
Local $sSubst = "{"\1,\4","\7,\10","\13,\16"}\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