#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)((case) (.*):)([.\s]*)((return) (.*);)"
Local $sString = " switch (frequency)" & @CRLF & _
" {" & @CRLF & _
" case GIIncomeFrequencyEnum.ANNUALLY:" & @CRLF & _
" return QuotingPeriodType.Yearly;" & @CRLF & _
" case GIIncomeFrequencyEnum.QUARTERLY:" & @CRLF & _
" return QuotingPeriodType.Quarterly;" & @CRLF & _
" case GIIncomeFrequencyEnum.MONTHLY:" & @CRLF & _
" return QuotingPeriodType.Monthly;" & @CRLF & _
" case GIIncomeFrequencyEnum.BI_WEEKLY:" & @CRLF & _
" return QuotingPeriodType.Every2Weeks;" & @CRLF & _
" case GIIncomeFrequencyEnum.WEEKLY:" & @CRLF & _
" return QuotingPeriodType.Weekly;" & @CRLF & _
" case GIIncomeFrequencyEnum.DAILY:" & @CRLF & _
" return QuotingPeriodType.Daily;" & @CRLF & _
" case GIIncomeFrequencyEnum.HOURLY:" & @CRLF & _
" return QuotingPeriodType.Hourly;" & @CRLF & _
" case GIIncomeFrequencyEnum.ONE_TIME:" & @CRLF & _
" return QuotingPeriodType.OneTime;" & @CRLF & _
" case GIIncomeFrequencyEnum.SEMI_MONTHLY:" & @CRLF & _
" return QuotingPeriodType.SemiMonthly;" & @CRLF & _
" default:" & @CRLF & _
" return QuotingPeriodType.Yearly;" & @CRLF & _
" }"
Local $sSubst = "$2 $7:$4$6 $3;"
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