Originally Posted By: jaytea
hey Raccoon, this works for single letter function names: https://regex101.com/r/YrBB2y/1
Code:
//echo -a $regsubex(X(1) X(2) X(4) Y(2) Y(3) Y(7) Z(4) Z(5) Z(6),/(?<=([A-Z]))\(\d+\)\K \1/g,)
> X(1)(2)(4) Y(2)(3)(7) Z(4)(5)(6)

I don't know why I didn't think about look-behinds, since they are indeed single letter and so static in length. Interesting! Thanks!


Well. At least I won lunch.
Good philosophy, see good in bad, I like!