How to do this:
    $str =~ s/a(b)c(d)e/func($1,$2)/eg;
in Ruby ?