McDarren - I realise you've got most of this working already. You're saying that you're trying to abstract the keyword-lookup. I've done something very similar, and posted it here. In your case, you want to change the delimiters, but I think it can be used as a framework for a very good generic-lookup-and-then-modify tool. In fact, I use this code in production.
Just create an expand_var function, and use that to do lookups.
In reply to Re: Evaluating a regex replacement value
by Tanktalus
in thread Evaluating a regex replacement value
by McDarren
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |