+---------- On Feb 22, Patrick Spence said:
> My problem is I cannot insert the \ before the & and then wrap with braces..
> I am pulling the string to convert from a database and piping it through my
> macro routine and I have not been able to figure out how to get it to work
> right.

You need to do a regsub on the subspec to hide the backslashes and
ampersands:

proc insert_macro { thestring key macro} {
    regsub -all {[\\&]} $macro {\\&} macro
    regsub -all -- $key $thestring $macro thestring;
    return "$thestring"
}

Reply via email to