Im looking for a regsub function that looks for a calculation identifier like $sin, $cos, $int etc. etc. and puts $calc inside the brackets, but only if there are no commas inside the brackets, few examples:
Code:
;Put $calc inside the functions:
$sin(2 + 3)  -->  $sin($calc(2 + 3))
$int(2) + 4  -->  $int($calc(2)) + 4

;If there are only brackets, it should stay this way:
(4 + 6) * 4  --> (4 + 6) * 6

;Functions with commas should stay the way they are:
$rand(2,6) * 6  -->  $rand(2,6) * 6

Any help, im not so good with regular expressions