I want to replace entries in a csv list, where the list parser can be arbitrary (eg: ,;:|). An example follows:
\def\x{r;s;t;x;y;z}
In this list I want to efficiently replace r,t,x by a,b,c via, say,
\replaceentries\x{r;s;t}{a;b;c}
But I may also end up with unbalanced pairs, like in
\replaceentries\x{r;s;t}{a;b;c;d;e}
and I don't want TeX to complain.
Please has anyone solved this problem before, or perhaps found a solution in a package? Otherwise, I think I can give it a try, but why reinvent the wheel?