Post History
JavaScript (Node.js), 148 bytes s=>s?eval(s.replace(/([^()])\1*/g,(m,g)=>(g=='!'?'+':g)+m.length).replace(/\(/g,'*(').replace(/-(\d|\(.+?\))\^(\d+)/g,(m,g,h)=>'-('+g+'**'+h+')')):0 Abu...
Answer
#1: Initial revision
# [JavaScript (Node.js)], 148 bytes ```javascript s=>s?eval(s.replace(/([^()])\1*/g,(m,g)=>(g=='!'?'+':g)+m.length).replace(/\(/g,'*(').replace(/-(\d|\(.+?\))\^(\d+)/g,(m,g,h)=>'-('+g+'**'+h+')')):0 ``` Abuses regex replacements and evals. Is it pretty? Nope. Is it optimized? Nope. Does it work? Maybe. I'll try to golf it later. [Try it online!][TIO-ks8g3fxd] [JavaScript (Node.js)]: https://nodejs.org [TIO-ks8g3fxd]: https://tio.run/##TYzBboMwEETP8VeY0@56MbTXRIYPiYOEiDGtCI4wyiXpt1OHRkr3sNp5Mzvf7a2N3fx1XfQUzm7tzRpNFWt3a0eMxeyuY9s5LPHYIJ3IfqrS53jJPZkKvTGQQQ0Me098KUY3@WWg95fFlAaF8I9ptOeHxYJrS2SbpJhenfmQWkEjsGdQCnhgICDaf6xdmOIiFxeXKI08ih3wcyBPl9Y6hfONYRK6LDczyzKl6BVpmma7QJwOQvRhlvjulKH/6yZ5F7snD6MrxuBxc1mC1FVaLPuNEB3Ez/oL "JavaScript (Node.js) – Try It Online"