let key = 'V3';
var md = 'V3(V3(V3(V3(V3(V3(V3(V3(V3(V3(V3(V3(V3(V3(V3(V3(V3(V3(V3(V3(V3(V3(V3((rT[TT.lh("^LQ+F", DM)](rT[TT.XE("9STVB[8", PM)][TT.bP("RQP/F,=1>\x3f", IM)]) + QM(rT[TT.lh("^LQ+F", DM)](rT[TT.XE("9STVB[8", PM)][TT.X2(FM, dM, NA)]), wA)), QM(rT[TT.lh("^LQ+F", DM)](rT[TT.XE("9STVB[8", PM)][TT.b2(mM, fM, vA)]), LA)), QM(rT[TT.lh("^LQ+F", DM)](rT[TT.XE("9STVB[8", PM)][TT.q2(bw, HM, nK)]), YA)), QM(rT[TT.lh("^LQ+F", DM)](rT[TT.CE("QU", jW)][TT.qP("A5!<", AM)]), gA)), QM(rT[TT.lh("^LQ+F", DM)](rT[TT.XE("9STVB[8", PM)][TT.VP("ZTW1U\'M(54!", KM)]), jA)), QM(rT[TT.lh("^LQ+F", DM)](rT[TT.XE("9STVB[8", PM)][TT.SP("VFg>G*577#W42", ZG)]), JA)), QM(rT[TT.lh("^LQ+F", DM)](rT[TT.XE("9STVB[8", PM)][TT.vB("M\\CGU8M;>19!A04\t", tM)]), nK)), QM(rT[TT.lh("^LQ+F", DM)](rT[TT.XE("9STVB[8", PM)][TT.NP("E=093\b6E<2", WM)]), TK)), QM(rT[TT.lh("^LQ+F", DM)](rT[TT.XE("9STVB[8", PM)][TT.vP("JGpOF\'[", wM)]), vA)), QM(rT[TT.lh("^LQ+F", DM)](rT[TT.XE("9STVB[8", PM)][TT.JP("HRK`Z$M; 9=\"", lM)]), lA)), QM(rT[TT.lh("^LQ+F", DM)](rT[TT.XE("9STVB[8", PM)][TT.xP("\\L\f}9d771> *r#>D_]F", GM)]), VA)), QM(rT[TT.lh("^LQ+F", DM)](rT[TT.XE("9STVB[8", PM)][TT.ZP("NN\x407:59>Q0WKX\x40", GK)]), UA)), QM(rT[TT.lh("^LQ+F", DM)](rT[TT.XE("9STVB[8", PM)][TT.jP("^&<6LMDO\x40#G697; v;5\x40Y", MM)]), SA)), QM(rT[TT.lh("^LQ+F", DM)](rT[TT.XE("9STVB[8", PM)][TT.V2(OM, tM, VA)]), CA)), QM(rT[TT.lh("^LQ+F", DM)](rT[TT.XE("9STVB[8", PM)][TT.S2(zG, XA, MK)]), NA)), QM(rT[TT.lh("^LQ+F", DM)](rT[TT.XE("9STVB[8", PM)][TT.UP("!V$2QpTGUM!\x07)!86^4VN", CM)]), qA)), QM(rT[TT.lh("^LQ+F", DM)](rT[TT.XE("9STVB[8", PM)][TT.sP("\"7=&V&\x00NX}L_", CA)]), bA)), QM(rT[TT.lh("^LQ+F", DM)](rT[TT.XE("9STVB[8", PM)][TT.zP("+1>66R69", gM)]), pA)), QM(rT[TT.lh("^LQ+F", DM)](rT[TT.XE("9STVB[8", PM)][TT.rI("PF<A;1\x07=>8V\'", cM)]), OA)), QM(rT[TT.lh("^LQ+F", DM)](rT[TT.XE("9STVB[8", PM)][TT.TI("G>G*1\x077.Z1D^ZJSP;1 &%<]", YM)]), EK)), QM(rT[TT.lh("^LQ+F", DM)](rT[TT.XE("9STVB[8", PM)][TT.nI("\'7.8Z!62b\\\\FU.[", LM)]), kA)), QM(rT[TT.lh("^LQ+F", DM)](rT[TT.XE("9STVB[8", PM)][TT.RI("RXSH\x40M5$\x3f -!J8DZT", lM)]), rK)), QM(rT[TT.lh("^LQ+F", DM)](rT[TT.N2(pM, kM, JA)][TT.SE("U\\CP}$\\", nM)]), MK)), QM(rT[TT.lh("^LQ+F", DM)](rT[TT.CE("QU", jW)][TT.EI("[,8", XM)]), QK))';
//var md = 'V3(V3(V3(V3(V3(V3(V3(V3(V3(V3(V3(V3(V3(V3(V3(V3(V3(V3(V3(V3(V3(V3(V3((rT[TT.lh("1", DM)](rT[TT.XE("1", PM)][TT.bP("1", IM)]) + QM(rT[TT.lh("1", DM)](rT[TT.XE("1", PM)][TT.X2(FM, dM, NA)]), wA)), QM(rT[TT.lh("1", DM)](rT[TT.XE("1", PM)][TT.b2(mM, fM, vA)]), LA)), QM(rT[TT.lh("1", DM)](rT[TT.XE("1", PM)][TT.q2(bw, HM, nK)]), YA)), QM(rT[TT.lh("1", DM)](rT[TT.CE("1", jW)][TT.qP("1", AM)]), gA)), QM(rT[TT.lh("1", DM)](rT[TT.XE("1", PM)][TT.VP("1\'", KM)]), jA)), QM(rT[TT.lh("1", DM)](rT[TT.XE("1", PM)][TT.SP("1", ZG)]), JA)), QM(rT[TT.lh("1", DM)](rT[TT.XE("1", PM)][TT.vB("1", tM)]), nK)), QM(rT[TT.lh("1", DM)](rT[TT.XE("1", PM)][TT.NP("1", WM)]), TK)), QM(rT[TT.lh("1", DM)](rT[TT.XE("1", PM)][TT.vP("1\'", wM)]), vA)), QM(rT[TT.lh("1", DM)](rT[TT.XE("1", PM)][TT.JP("1", lM)]), lA)), QM(rT[TT.lh("1", DM)](rT[TT.XE("1", PM)][TT.xP("1", GM)]), VA)), QM(rT[TT.lh("1", DM)](rT[TT.XE("1", PM)][TT.ZP("1", GK)]), UA)), QM(rT[TT.lh("1", DM)](rT[TT.XE("1", PM)][TT.jP("1", MM)]), SA)), QM(rT[TT.lh("1", DM)](rT[TT.XE("1", PM)][TT.V2(OM, tM, VA)]), CA)), QM(rT[TT.lh("1", DM)](rT[TT.XE("1", PM)][TT.S2(zG, XA, MK)]), NA)), QM(rT[TT.lh("1", DM)](rT[TT.XE("1", PM)][TT.UP("1", CM)]), qA)), QM(rT[TT.lh("1", DM)](rT[TT.XE("1", PM)][TT.sP("1", CA)]), bA)), QM(rT[TT.lh("1", DM)](rT[TT.XE("1", PM)][TT.zP("1", gM)]), pA)), QM(rT[TT.lh("1", DM)](rT[TT.XE("1", PM)][TT.rI("1\'", cM)]), OA)), QM(rT[TT.lh("1", DM)](rT[TT.XE("1", PM)][TT.TI("1", YM)]), EK)), QM(rT[TT.lh("1", DM)](rT[TT.XE("1", PM)][TT.nI("\'1", LM)]), kA)), QM(rT[TT.lh("1", DM)](rT[TT.XE("1", PM)][TT.RI("1", lM)]), rK)), QM(rT[TT.lh("1", DM)](rT[TT.N2(pM, kM, JA)][TT.SE("1", nM)]), MK)), QM(rT[TT.lh("1", DM)](rT[TT.CE("1", jW)][TT.EI("1", XM)]), QK))';
//var md = 'V3(V3(V3((LA + Rl), LA), Rl), LC = V3(V3(V3(V3((hg + Gg), Rl), Mg(QK, z3(Jm, [vM, KA, LC]))), Rl), LC))';
let len = md.match(eval(`/${key}/gm`)).length;
for(let p = 0; p < len; p++){
let startIndex = md.indexOf(Array(p + 2).fill('(').toString().replace(/,/g ,''));
let leftbreak = [], rightbreak = [] ,sk = 0, dk = 0;
for(let n = startIndex; n < md.length; n++){
if(md[n] == '"' && md[n + 1] != '"'){
sk++;
sk % 2 == 0 ? dk = 0 : '';
}
if(md[n] == "'" && md[n + 1] != "'"){
dk++;
dk % 2 == 0 ? sk = 0 : '';
}
if(md[n] == '(' && sk % 2 == 0 && dk % 2 == 0){
leftbreak.push('(');
}else if(md[n] == ')' && sk % 2 == 0 && dk % 2 == 0){
rightbreak.push(')');
}
if(leftbreak.length === rightbreak.length && sk % 2 == 0 && dk % 2 == 0){
let Target = `${key}${md.substring(startIndex ,n + 1)}`; //要替换的当前匹配项
let clean = Target.substring(3 ,Target.length-1);
let cleftbreak = [], crightbreak = [] ,csk = 0, cdk = 0;
for(let c = 0; c < clean.length; c++){
if(clean[c] == '"' && clean[c + 1] != '"'){
csk++;
csk % 2 == 0 ? cdk = 0 : '';
}
if(clean[c] == "'" && clean[c + 1] != "'"){
cdk++;
cdk % 2 == 0 ? csk = 0 : '';
}
if(clean[c] == '(' && csk % 2 == 0 && cdk % 2 == 0){
cleftbreak.push('(');
}else if(clean[c] == ')' && csk % 2 == 0 && cdk % 2 == 0){
crightbreak.push(')');
}
if(clean[c] == ',' && (cleftbreak.length === crightbreak.length) && csk % 2 == 0 && cdk % 2 == 0){
//console.log('(' + clean.substring(0,c) + ' +' + clean.substring(c + 1 ,clean.length) + ')');
md = md.replace(Target ,'(' + clean.substring(0,c) + ' +' + clean.substring(c + 1 ,clean.length) + ')');
console.log(md);
console.log('-----------------------------------------------------------------');
break;
}
}
break;
}
}
}
console