#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?mx)^\h*" & @CRLF & _
"(?<linetype>[0123456])\h+" & @CRLF & _
"(?<color> (?&Number) )\h+" & @CRLF & _
"(?<xrot> (?&Number) )\h+ (?<yrot> (?&Number) )\h+ (?<zrot> (?&Number) )\h+" & @CRLF & _
"(?<xpos> (?&Number) )\h+ (?<ypos> (?&Number) )\h+ (?<zpos> (?&Number) )\h+" & @CRLF & _
"(?<xcam> (?&Number) )\h+ (?<ycam> (?&Number) )\h+ (?<zcam> (?&Number) )\h+" & @CRLF & _
"(?<xsca> (?&Number) )\h+ (?<ysca> (?&Number) )\h+ (?<zsca> (?&Number) )\h+" & @CRLF & _
"(?<filename>\S+[.]\S+)" & @CRLF & _
"$" & @CRLF & _
"" & @CRLF & _
"(?(DEFINE)" & @CRLF & _
" (?<Number> [-]? \d+ (?> [.]\d* )? (?> [Ee] [+-]? \d+ )? )" & @CRLF & _
")"
Local $sString = "1 0 0 0 0 1 0 0 0 1 0 0 0 1 3024.dat" & @CRLF & _
"#linetype color XROT YROY ZROT XPOS YPOS ZPOS XCAM YCAM ZCAM XSCA YSCA ZSCA FILE"
Local $sSubst = "${linetype} ${color} ($xrot,$yrot,$zrot) {$xpos,$ypos,$zpos} <$xcam,$ycam,$zcam> [$xsca,$ysca,$zsca] "$filename""
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