import – Convert GiNaC harmonic polylogarithms to HPL packages’ notation in mathematica

A general out put from GiNaC(https://www.ginac.de/) of harmonic polylogarithms is

H(a,b,c...,x)

We want to convert it to mathematica version (https://www.physik.uzh.ch/data/HPL/)

HPL({a,b,c...},x)

Note: we need “a general string expression” for the “a,b,c…” in
H(a,b,c...,x) as we have to dealing with a lot of H‘s like:

converting H(2,2,x),H(2,1,x),H(2,1,2,x),H(1,2,3,4,x),H(1,2,3,4,5,x),etc

to HPL({2,2},x),HPL({1,2},x),HPL({1,2,3},x),HPL({1,2,3,4},x),HPL({1,2,3,4,5},x)