i was trying to make a $rp_mod that transforms this string: (|-2|+1)/|-3| in this string: (2+1)/3, so i begin making a alias like this:

Code:
alias rp_mod {
  var %x = $1, %y = $regsub($1, /\|([^|]*)\|/g, \1, %x))
  return %x
}


it only removes the |'s, but i cant do just $abs(\1) or anything like this. so, i want a $\n ident, like $\1, for use in this cases. the alias might be like this:

Code:
alias rp_mod {
  var %x = $1, %y = $regsub($1, /\|([^|]*)\|/g, $abs($\1), %x))
  return %x
}


ps: anybody knows how i can do this?
pps: how about the || built-in in the $calc identifier?


__________
dark_light @ irc.brasnet.org