Skip to main content
3 of 4
deleted 10 characters in body
tsh
  • 35.6k
  • 2
  • 34
  • 129

JavaScript (Node.js), 55 bytes

f=(a,b=a.replace(/\((.>)?(.)(<.)?\)/,'$2'))=>a<b?f(b):b

Try it online!

Repeat apply regex replace until no match found. The regex /\((.>)?(.)(<.)?\)/ get the calculate result as 2nd capturing group.


Save 1 byte, thanks to Arnauld

tsh
  • 35.6k
  • 2
  • 34
  • 129