# [JavaScript (Node.js)], 50 bytes <!-- language-all: lang-javascript --> f=a=>a[1]?f(a.replace(/\((.>)?(.)(<.)?\)/,'$2')):a [Try it online!][TIO-kkrv14fw] [JavaScript (Node.js)]: https://nodejs.org [TIO-kkrv14fw]: https://tio.run/##TVLRTsMwDHzPV/QBrbYGmeCRubcnvoIhEZUOhso6dRUviG8vjp1OSJWbOHfny7Wf6Ttd2vF4nu5Ow1s3z4cmNUjP9y@7A6U4duc@tR1t9kQRvKPIJJF3e97c1jcPNfNjmqeqqV4DIEGEBMKBALDuSfcCpYgwi@4JeiSsLWi/YES7ogTFkPW1GCbTlJNfuWtUn2AbZei5KjrLBmmzAEtTGVkjK3rJhrQ6BqYlbpOzXwf6BZYxyMPFrdvMoHOKMRRBsxyKLX3KKcwgPIHsVPDfFNwPigcpzmDnEIfAqXBXXALIa9XwUEqgVlzLkYJljlxvme9iK3EpLFpyzdboWBLDkpg5DdfoyfE56sV9/hg2TcN8jdN4/CKOl3N/nKjen2rehikehvEptR/UVw2qn1BV7XC6DH0X@@Gd@tXqQDXV635ds/5e4Ze38x8 "JavaScript (Node.js) – Try It Online" Repeat apply regex replace until only 1 char left. The regex `/\((.>)?(.)(<.)?\)/` get the calculate result as 2nd capturing group. ---- Save 1 byte, thanks to [Arnauld](https://codegolf.stackexchange.com/users/58563/arnauld)