s{total of (.*?) and (.*?)\n}{'total is ' . ($1+$2) . '\n!'}eg; [download]
In reply to Re: addition in regular expressions by moritz in thread addition in regular expressions by texuser74