Well, the regsub will work better. I figured regex would probably be shorter, but I'm not well versed in it.

However, make sure you edit those parse sections so they are $1- and not $1.

And, you'll need to unset the variables at some point. You'll just need to figure out when to do it.