in reply to String expansion script

Note 1: I wrote this as a quick hack one day that I got tired of writing ad hoc solutions for the same task. I am perfectly aware that the use of $`, $& and $' is generally discouraged for various reasons. In this case it seemed to me that it provided the simplest way to achieve what I wanted.

Note 2: I am perfectly aware that all in all this is not probably the most efficient way to do this, with potentially huge lists of parameters passing through recursive subs. All I can say is that it has worked excellently under all conditions of utilization I've needed. I typically use it like thus:

echo 'http://foo.org/{bar:baz}/gallery[1:100]/pic[1:12].jpg' | xstr | +wget -i - -nH -x