Originally Posted By: Wims
I suppose you're not looking for westor's code as you could write something like it but rather an ugly $regsubex, this is the only thing that came to mind immediately

Quote:
//echo -a $regsubex(X(1) X(2) X(4) Y(2) Y(3) Y(7) Z(4) Z(5) Z(6),/([XYZ])(\(\d+\) (?:\1\(\d+\)(?= \1) )*\1\(\d+\))/g,\1 $+ $remove(\2,$chr(32),\1))
if you want it done with a static substitution, I don't think it's possible (or not without assuming too much) but people are surprising with regex...


I FUCKING HATE REGEX !!!!!!!!!!!!!