#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)(view_manage_opportunities),(view_page[^,]*)"
Local $sString = "DCA,customer1,company1,SID1,cherie,cherie,"view_page_modulepicker,explore_more_connect with people" DCA,customer2,company2,SID2,cherie,cherie,"view_manage_opportunities,view_page_modulepicker,back_to_opp,view_page_modulepicker" DCA,customer1,company1,SID1,cherie,cherie,"view_manage_opportunities,view_page_modulepicker,explore_more_connect with people" DCA,customer1,company1,SID1,cherie,cherie,"view_page_modulepicker" DCA,customer1,company1,SID1,cherie,cherie,"view_manage_opportunities" DCA,customer4,company1,SID4,cherie,cherie,"view_manage_opportunities,view_page_actionSource" DCA,customer4,company1,SID4,cherie,cherie,"view_manage_opportunities,view_page_homePage" DCA,customer4,company1,SID4,cherie,cherie,"view_manage_opportunities,view_page_capabilities""
Local $sSubst = "$2,$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