alias addcalc {
var %x
.echo -q $regsub($1,/(\$(?!calc\50)[a-z\d]+)\(((?:[^,()]*\([^,()]*\))*[^,()]*)\)/gi,\1(\$calc(\2)),%x)
return %x
}
Supports parentheses within these functions as long as there are no mismatches, for example: $addcalc( $!sin(1+1) $!tan((2+3)*5) ). Won't do anything with $calc itself