#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)([{,]([A-z0-9 ]+?)[,][A-z0-9, ]*?)\2+([,}])"
Local $sString = "\cite{Duran2016TIE,Vu2019ICIT,Ryu2006TIA,Zhao1996TECa,Zhao1996TECb,Guzman2012EPE,Guzman2016TIE,Duran2016TIE,Vu2019ICIT,Chen2020TIE,Chen2020Access,Priestley2020TIE,Fan2020TVT,Vu2019ICIT,Bermudez2018TPEL,Chikondra2021TIE,Che2014TPEL,Bermudez2018TPEL,Vu2019ICIT,Liu2018TPEL,Tian2018TIA,Liu2018TPEL,Liang2018Access,Vu2022TPEL,Tian2017TPEL,Tani2012TPEL,Priestley2020TIE,Fnaiech2010TIE,Betin2012TIE,Zhao1996TECa,Zhao1996TECb,Geng2019Access,Wang2017TIE,Lu2017TIA,Lu2018IET,Lu2019TIE,Liang2020Access,Souza2018TIA,Souza2020TIA,Vu2022TPEL,Zhou2016TEC,Bermudez2017TIE,Chikondra2021TIE,Zhou2021TIE,Huang2020TIE,Zhou2020TPEL,Huang2020TPEL,Guzman2012EPE,Guzman2014TIE,Guzman2016TIE,Prieto2018TIE,Liu2020TPELb,Huang2018JESTPE,Tao2020TPEL,Tao2021TPEL,Priestley2020TIE,Ryu2006TIA,Wang2018TIA,Khadar2019MMC,Chen2020Access,Chen2020TIE,Xiong2020TIE,Hu2021JESTPE,Tian2021TEC,Tian2017TPEL,Cheng2018TPEL,Zhou2017TIE,Tian2017TPELb,Tian2021TIE,Tian2018TIA,Liu2018TPEL,Tian2021TIEb,Chen2019TIE,Liang2018Access,Xu2019TIE,Bermudez2018TPEL,Vu2019ICIT,Fan2020TVT,Duran2016TIE,Vu2019ICIT}"
Local $sSubst = "$1$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