Believe it or not, I can figure out how I would get it to do it in BBC Assembler (6502 processor) but not in some modern fancy language

perl -pi.bak -e"s/(\w+(?:\([^()]*\))?)\^(\w*(?:\(.*?\))?)/pow($1,$2)/g;" your_formula_filename(s)
#!/Perl/bin/perl.exe -pi.bak s/(\w+(?:\([^()]*\))?)\^(\w*(?:\(.*?\))?)/pow($1,$2)/g;
perl the_perl_script formula_file1 formula_file2
(\w+(?:\([^()]*\))?)\^(\w*(?:\(.*?\))?)
pow($1,$2)
Comment