#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = ".*-> addField\(('\S*').*?, \['type' => new (\S*?)Type.*"
Local $sString = "-> addField('id' , ['type' => new IntType , 'description' => __('id')])" & @CRLF & _
" -> addField('type_mandaat' , ['type' => new StringType , 'description' => __('type mandaat')])" & @CRLF & _
" -> addField('bedrag' , ['type' => new BedragType , 'description' => __('bedrag')])" & @CRLF & _
" -> addField('datum_expertise_plaatsgevonden' , ['type' => new DateType , 'description' => __('datum van expertise')])" & @CRLF & _
" -> addField('datum_ontvangst_rapport' , ['type' => new DateType , 'description' => __('datum van ontvangst rapport')])" & @CRLF & _
" -> addField('omschrijving' , ['type' => new StringType , 'description' => __('omschrijving')])" & @CRLF & _
" -> addField('wrakwaarde' , ['type' => new BedragType , 'description' => __('wrakwaarde')])" & @CRLF & _
" -> addField('forfait' , ['type' => new BooleanType , 'description' => __('forfait')])" & @CRLF & _
" -> addField('total_loss' , ['type' => new BooleanType , 'description' => __('total loss')])" & @CRLF & _
" -> addField('kosten_expertise' , ['type' => new FloatType , 'description' => __('kosten expertise')])" & @CRLF & _
" -> addField('experts' , ['type' => new ListType(new ExpertInput), 'description' => __('experts')]);"
Local $sSubst = "\1 => ['type' => '\2'],"
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