#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)((\||(?<!^)\G)[^,|]*),(?=.*\|)"
Local $sString = "div-item-2,4,maintype:social| heading:sdfsdf| social: 1, 2, 3 | table:Social| item:3| align:vertical| style:icon| isactive:1,8,0" & @CRLF & _
"div-item-0,4,maintype:menu| heading:Quick, Link| table:Menu | menuid:1| align:vertical| style:icon| isactive:1,0,0" & @CRLF & _
"div-item-1,4,maintype:text| heading: Name | title: Learn from here| logo:/photos/20/01.jpg| description: This is some description, so you can stay with us| isactive:1,4,0"
Local $sSubst = "$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