#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?ms)model: ([^\n]+)(.*)bitmap [^\n]+"
Local $sString = "# model: pmy0_footr015" & @CRLF & _
"filedependancy Unknown" & @CRLF & _
"newmodel pmy0_footr015" & @CRLF & _
"setsupermodel pmy0_footr015 NULL" & @CRLF & _
"classification Character" & @CRLF & _
"setanimationscale 1.0" & @CRLF & _
"beginmodelgeom pmy0_footr015" & @CRLF & _
"node dummy pmy0_footr015" & @CRLF & _
" parent NULL" & @CRLF & _
"endnode" & @CRLF & _
"node trimesh pmy0_footr015g" & @CRLF & _
" parent pmy0_footr015" & @CRLF & _
" position 0.0 0.0 0.0" & @CRLF & _
" orientation 1.0 0.0 0.0 0.0" & @CRLF & _
" bitmap pmh0_footr050" & @CRLF & _
" verts 15" & @CRLF & _
" -0.0378169 -0.00381612 0.00857995"
Local $sSubst = "model: $1$2bitmap $1"
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