[Question]
  [
*Originally [sandboxed](https://codegolf.meta.stackexchange.com/a/19105/78410) by [@xnor](https://codegolf.meta.stackexchange.com/users/20260/xnor)*
Left-or-right is a very simple language @xnor made up. Its expressions are made of arrows `<` (left), `>` (right), and parentheses. The goal is to evaluate an expression to either `<` or `>`.
An expression `A<B` picks the left item `A`, while `A>B` picks the right one `B`. Think of `<` and `>` as arrows pointing to the item we want, not as comparison operators.
Take, for example, `><>`. The operator in the middle is `<`, and confusingly, the items on each side `A` and `B` are also arrows. Since the operator tells us to take the left one `A`, which is `>`. So, `><>` equals `>`.
Expressions also nest. We can replace the expression with its value. So, for example, `(><>)<<` equals `><<` equals `>`. And, `>(><>)<` equals `>><` equals `<`. For another example, `(><>)(<<<)(>><)` equals `><<` equals `>`.
In the input, you'll be given a well-formed expression consisting of either a trio of arrows like `><>` or the result of repeatedly replacing some arrow by a trio of arrows in parens like `><(><>)` . You can assume the input won't already be a lone arrow. You may alternately accept the whole inputs encased in parens like `(><>)` or `(<(><>)>)`.
The input is given as a flat string consisting of symbols `<>()`. You may not take it in a pre-parsed form like a tree.
The shortest code in bytes wins.
## Test cases
Generated using [this script](https://tio.run/##bZDBcoMwDETvfMXeLDUZDy03CvxIk0MSTHALNmORdvL11BDSaab1RaPVW2nHw3VsvcumqQm@RzCw/eDD@JTc@oOrY7lrtWlwNo5qM4xtmeqU8wTx2WYliVFgmeZx13gJDqfW25MhVVSKF3gZY1Mi1dkirKAihQ2U0u/eOnr7ucNofICFdfORs6GM9zyTrJZA4rtPQ7JG@WptZ9BFszAqZDkEJeRypKB2RJoLvWO1ReyeYxF@fQB0FZFH4HdGSWSml3B/cr2kvI9zLfGv6MNcy@7QH@sDJKd7xu0tGHMye2X2iuQYgnVj1P9VVytP0zc).
### Evaluates to `<`
```
>><
<<(<><)
(>>>)><
(<(<<>)(<<<))<<
((>(>><)>)(><>)>)><
(<<(>(<>>)<))((><>)(><<)>)(<<<)
((<<<)<>)((>><)<(<><))((>>>)<<)
>(>((><>)<>)(<>>))((>><)((><>)<<)<)
((><<)(><<)(<<>))(<(>><)(>><))(<<(<<>))
(<(><<)(>(>>>)>))((>>>)>>)((<>(>><))<<)
```
### Evaluates to `>`
```
<>>
((<<<)>(<<>))(><<)>
((>>>)<>)<((<<<)>>)
>(>>(<<<))(>((<>>)<<)<)
((><>)(<<>)>)(<<(<<<))(<(>>>)<)
(><((><>)><))(>(>>(>>>))(<><))(>>>)
(((>><)<>)(><>)(><>))(<<(<>>))(<<>)
((><>)<(<<(<<>)))((<(<<>)<)(<><)>)(>>>)
(<<(<><))(((<>>)><)(><<)(><>))(<(><>)>)
((>>>)<<)(<(<><)<)((<<(<<<))>(>(><>)<))
```
  
[Answer]
## x86-16 machine code, ~~31~~ ~~26~~ 22 bytes
Saved 5 bytes thanks to @Bubbler.
Saved 4 bytes thanks to @640KB.
```
0000:0000  AC 3C 29 74 03 50 EB 0A-5A 58 3C 3E 58 74 01 92   .<)t.P..ZX<>Xt..
0000:0010  58 52 E2 EC 58 C3                                 XR..X.
```
Callable function.
Expects `SI` = address of code, `CX` = length of code.
Expects the code to be enclosed in `(...)`:
> 
> You may alternately accept the whole inputs encased in parens like `(><>)` or `(<(><>)>)`.
> 
> 
> 
Returns the output at `AL`.
Disassembly:
```
         LOOP:                  ; Main loop:
AC            LODSB             ; AX = [SI++]
3C29          CMP     AL, ')'   ; AX == ')'?
7403          JZ      BRACE     ; * If so, jump to 'BRACE'
         PUSHSTH:               ; Otherwise...
50            PUSH    AX        ; * Push AX onto stack
EB0A          JMP     END       ; * Jump to 'END'
         BRACE:                 ; If AX == ')'?
5A            POP     DX        ; * pop TOS to DX
                                ;   * (So DX is now the rightmost angle brace)
58            POP     AX        ; * pop TOS to AX
                                ;   * (So AX is now the middle angle brace)
3C3E          CMP     AL,'>'    ; * Compare current AL with '>' (result stored in PSW)
58            POP     AX        ; * AX = left argument
7401          JZ      RAB       ;   * If prev. value of AL == '>', jump to 'RAB'
         LAB:                   ; * Handle prev. value of AL == '<':
92            XCHG    DX,AX     ;   * DX = left argument instead
         RAB:                   ; Now, DX is the chosen value.
58            POP     AX        ; * Discard TOS (which is an excess '(')
52            PUSH    DX        ; * Push DX onto stack
         END:                   ; Finally,
E2EC          LOOP    LOOP      ; * Loop the above CX times
58            POP     AX        ; Pop TOS to AX
C3            RET               ; Return to caller
```
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 50 bytes
```
f=a=>a[1]?f(a.replace(/\((.>)?(.)(<.)?\)/,'$2')):a
```
[Try it online!](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)
[Answer]
# [><>](https://esolangs.org/wiki/Fish), 121 bytes
```
0&v
>o ;
^? <=1l~<;o~$?=">"$
<<v<<<&0 ~&~$?=">"$<
~]v&0[0~ < >
>>>i:0(?^   :>>>v
<< v<<<<<^? ="("<
+&^>>:")"=?^&:&2= ?^&1
```
[Try it online!](https://tio.run/##NYw9CsMwDIV3n0KYICS6OB2dZ/kgpR5LA4UMBY@@uqsQOr0/vvfav@85E/dgB22hVUJZPwPbMZZaosUlAB0AJxr87xDGs3N6pEEgC2a25yS1EVH20J2hEwL8sESJCDduZjlqLLVx5nsh13VOgRigYuKgmqpcxtzgLKHq@w8 "><> – Try It Online")
This code takes advantage of the `><>` functionality where a new stack/register can be created, code can operate on that new stack, then once that stack is closed, the results are merged back into the lower level stack.
It reads one character (codepoint really) at a time creating new stacks whenever it hits a `(` and closing them when a `)` is encountered.
The other logic use is a simple state machine, based on the contents of the register associated with the current stack.
When the value of the register is `0` the char just read is the left hand side of the statement, a value of `1` means it's the operator (`<` or `>`), and a value of `2` means we have the right hand side.
Anytime the state is `2`, the code can resolve the 3 character on the stack (RHS, OP, LHS) to get an answer for that operation.
When the input is exhausted, we'll be back at the base stack with either `1` or `3` entries on the stack. If there are `3` entries on the stack, the code does one final operation to resolve the stack, then the sole entry on the stack is printed as a character.
The code is broken up to save characters, but I'm going to explain it using the original code. The only difference is that direction shifts, extraneous spaces and directional indicators have been removed to make it easier to see what's happening. Well, unless I goofed when formatting it...
```
# initialization
0&v  # Set the register (state) to 0, call input loop
 [0]
# [0] loop to read input and process each char
       [1]    [2]    [3]    [4]
>>>i:0(?^:"("=?^:")"=?^&:&2=?^&1+&
.. i                               # Read next char/codepoint
    :0(                            # Check it codepoint < 0
       ?^                          # If true, all input done call [1]
         :"("=                     # Compare char to "("
              ?^                   # If true, call [2] to open new stack
                :")"=              # Compare char to ")"
                     ?^            # If true, call [3] to close stack
                       &:&         # Load and resave the register
                          2=       # Compare state to 2 (RHS,OP,LHS)
                            ?^     # If true, call [4] to pick answer
                              &1+& # Increment the register (state)
# [1] code to handle EOF
             [5]
        >~1l=?^$"<"=?$~o;
.. ~                 # Delete top of stack, clean-up
    1l=              # Compare stack size to 1
       ?^            # If true, call [5] to print/exit
         $           # Flip top two stack entrys, pulls OP to top
           ">"=      # Compare OP to ">"
               ?$    # If true, flip top two stack entries
                 ~   # Delete top of stack (the choice we don't want)
                  o; # Print top of stack as char, then exit 
# [5] called on EOF if the stack has only 1 entry
              >o;
.. o;           # Print top of stack as char, then exit
# [2] code to handle "(", stack a new stack
               >~0[0&
.. ~            # Delete top of stack, clean-up...
    0[          # Open a new stack with 0 entries from the old one
      0&        # Set the register (state) to 0
# [3] code to handle ")", close the stack
                       >~]
.. ~]           # Delete top of stack, close stack to merge down
# [4] code to resolve a stack with RHS,OP,LHS
                             >$">"=?$~&~0&
.. $            # Flip top two stack entrys, pulls OP to top
    ">"=        # Compare OP to ">"
        ?$      # If true, flip top two stack entries
          ~     # Delete top of stack (the choice we don't want)
           &~&0 # Set register (state) to 0
```
[Answer]
# [APL (Dyalog Extended)](https://github.com/abrudz/dyalog-apl-extended),  ~~30~~ 23 bytes
```
(⍎'(⊣⊢)'['(<>'⍳⍞])/'<>'
         '(<>'⍳⍞          take the input ⍞ and get the indices of '(<>'
                          this fills with the last index + 1 if not found, saving 1 char
  '(⊣⊢)'[ stuff ]         index into '(⊣⊢)', replacing <> with ⊣⊢, the left and right tack functions
 ⍎                        evaluate this as a train
                          APL trains of the form (f g h) when applied to left and right arguments x and y produce (x f y) g (x h y)
                          This translates directly to this language
                          Replacing <> with ⊣ and ⊢ which do the same thing, the input becomes a valid function in APL
(    train       )/'<>'   Reduce over '<>', which uses '<' as a left argument and '>' as a right one
```
[Try it online!](https://tio.run/##VVE7TsQwFOx9inS2ixUc4Gl6Kg6AKII2S8EKEKKACwBaKSsaSijgCNzIFwnzPklE82Q/z8ybN@7v95vtc7@/u94MT4/D7XbYTu34cXbeXt5PU3t73U2ljcdc2uGnHb5rvshFkNv428avy3qSeZkIm3ZdAiTtkggBUhMbBUDVJo/sCiqL1CqKKwV8l8om@OJA4oR9IY@4Yi8shlKq8fSgfaP7NLuQYwjqOtMGsh3QaJLjOqrrRa2xOgqmJ27YkBJQ32ceBrUgvoRNTgyOseXctfGzu3oY@pukgQCLbcQoW8lNwHxKvCMWgCelmwj@m4b7RXiUcI5AQBwEp8Nd14gJPqFEeBG@FddzrGCdJksWuq@dxOWw6snyDyaBOVnMyZrjdWNVMIZ@y7yHfpxNrPUP "APL (Dyalog Extended) – Try It Online")
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 22 bytes
```
{`\((.>)?(.)(<.)?\)
$2
```
[Try it online!](https://tio.run/##VVEhcgNBDOP3jgCbHAjWKB8JSEFBSECnrI@/2pI3NyGeHVmWZO/P9@/z9XUcf497xM68xZ6BPW/33C7X4wgSuQUQqEe9CmAKi8LAYqMaEBIUv0BW581D4aix4oU6VcTSaM/1o3GNj5etzChdT8qw4KEOiByd1nXpaFXNovTgwOnspnqdZcaOAC9h501uKyJH1vFlSGXC9Dlh6dU6NfgZkM7GyYNJyWEQJtHjdMKck9AOMYeaQ6tYz1zwdMO59/oyWI6nHt43lwTXFbmuqMTnxq2gif6CtUd/khzL6h8 "Retina 0.8.2 – Try It Online")
Basically the port of my JavaScript answer in Retina. I just learnt how to write loop in past 10 minutes and got this.
`{`` loops the replace until nothing changed. The replacement calculate one step each time.
[Answer]
# [J](http://jsoftware.com/), 30 bytes
```
')/''<>'''".@,~'(',rplc&'<[>]'
```
[Try it online!](https://tio.run/##hVFNS8NAEL3vr1h6cHYhxuKxjg9B8NRTr1JEQmorgmJy9q/H@drgTUgm2Zn3Zua9fV82PZ3y/S5T7vI27@S97vPjYf@0UL0hYhDRpn/ofqhQ9/31MVwRP@NIS03jcP7MtB9Pc57Hac7D6zRO5OnTXf9ym4/acpsATsyFwTUVAFXORc6MKoFrZTkXSImrpCD5wLBkWQiCKZaXYBilCUc/mjWqT7CDMKQuHZ1lgyQZwEgKQ3toRw@6kETHwHqxr1l1Xwe6gDYGOpx9dZtZU/hyuLyd/zNGdgoRiOEmL4UEeaIKEwN3S1Ux/gqA747Yl0MFrA52CJwKV1DDLP2XHm5gmG/BezmS0ebw6ojqtj/2Vmi9eL0Ho6O5i@aubZrWayqO12tp2@vF2TQxvi6/ "J – Try It Online")
Very similar to rak1507's APL answer, though I had the idea independently -- it's natural for J, though loses some elegance because of the quote escaping.
* `rplc&'<[>]'` replace `<>` with `[]`, which in J are the "left" and "right" identity operators, meaning they return the left or right argument.
* `(` Prepend a left paren to that result.
* `')/''<>'''...,~` Append `)/'<>'` to the previous result.
* Now we have `( ~~input with [] instead of <>~~ )/'<>'`.
* Which is the same as: `'<' ( ~~input with [] instead of <>~~ ) '>'`
* `".@` Evaluate that string. From here, J trains and the definition of `[` and `]` do exactly what we want.
[Answer]
# [Python 3](https://docs.python.org/3/), ~~98~~ 74 bytes
Saved a whopping 24 bytes thanks to [ovs](https://codegolf.stackexchange.com/users/64121/ovs)!!!
```
import re
f=lambda p:p[1:]and f(re.sub('\(((.)<.|.>(.))\)',r'\2\3',p))or p
```
[Try it online!](https://tio.run/##pVLLbsJADLzzFatcdi3SSEClSsjxjxBU8UhKVAhRshwqyrenXnsDqD02B2fjHY/H47Rf/nBuFsNQn9pz501XTqr8uDlt9xvTLtvVbLneNHtTua7M@svW2cI5lwFm3xnxGwqwaWeLebGwaQtw7kw7@LL378ey8r3JjTMJESapSRAdEkI4OiICzTrOIgEHBEBNOWIAAmeJrx5I5AvkSkY6ueIgsFCsleEULoRAG8oHFymEqbVWmnI@YmOSiyJToNYQ9HFUGAkjqmqIEyhWpxr7UVCBOok2h4k409Ufh9EaFvDQTbGTDBVFkAjFCKBxBFK/wixIv2STKqaoEqN2GiGEiiIlINUN0SuKTVy0MC5BgjIqGOmpId4NCTPLCZWQnhjxvg8hodFfGv0V1U@DBw4pCesZhwkLlJ4glu4O5e6z7IKdtrjM3153NjVymi0sTCr@I72pG/P4KZcTw09YQOWss1M/tcDIkGy7uvGusld/My9krv3NXGODVZ/nCSbr2x9S3ec/WElYhx8 "Python 3 – Try It Online")
Takes an input string with enclosing in parentheses and returns whether it's left (`<`) or right (`>`).
[Answer]
# [Perl 5](https://www.perl.org/) `-p`, 32 bytes
```
s/\((.>(.)|(.)<.)\)/$2$3/g&&redo
```
[Try it online!](https://tio.run/##VVFBagNBDLvnHSF4DtmFht6EXpJjQimE7JL02Ld3YlueLD2MGTSyJHvW6@P22ftzPptNtKn9@sHUzm3ef@xP89fh8Lhelt6NRNsZYPCL3xxgS8wcA5sXf0AixuQ7SH958@A4vM15li9ekpWt0ReXwLO9vGQlhuuqMw0dLmqBaKUTuioRzatYTD0ocFN2UTXOMGNEgIYo5zAbCVmqSp9@zEiod1ZWarIIDf7PR0VjxUGFZDEIkah2KmCrjVAOVnuqPWeRnrjg5oZt7PFjkBw3PbxXnhIcS@RYYibeJg6F7IgfGHPEH6WjW/0t68/3cn/243p7AQ "Perl 5 – Try It Online")
Takes advantage of the spec allowing outside parentheses to be required.
[Answer]
# [Red](http://www.red-lang.org), ~~136~~ ~~120~~ 86 bytes
This version is courtesy @hiimboris (<https://gitter.im/red/parse>)!
```
func[s][r:["<"|">"]while[parse s[to change["("x: r["<"r |">"x: r]")"](x/1)to end]][]s]
```
[Try it online!](https://tio.run/##ZVLLbsMgELz3KxAnOFW9Wqv5iF4RhyjGTarUiXCq5tB/d/eB7Vj1YWXYYR4LtfTze@lTfhm6efgej2nKqXbJk//18PnndL6UdDvUqbgp3a/ueDqMHyX54B@dq4KrTpCyyj76HB6vb5GBZexzTnnK83Ct5XA8uckl9@L48wB5@yMKBIptFQDEtRe4R4hcKEZadwMYRpEb4O4OT9wjpmB80C4XRQrFel4W0lMa09cFn1tRrGEMaoBbDd42@dzGJxpWxC5XQ0J5yULELZPBLeoiDLFDFuzJBQvvXKMpaKpNH2qTGgZPGWDDkzCE/75hltFsUjOPJxTIgDAamPHYpoZNLbR5tnvRYryGJ@yVaR2NRNc/MlrseWm9IqXCMmwsw9YE@2kIk56SG1uyyZ2qstxGTu5Wz@Pdpa/rpee36bvOu8HV8nk9j/K@ZY/fc3Z5/gM "Red – Try It Online")
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~117~~ \$\cdots\$ ~~101~~ 98 bytes
Saved 10 bytes thanks to an idea from [Davide](https://codegolf.stackexchange.com/users/100356/davide)!!!  
Saved 3 bytes (and got below 100!) thanks to [ceilingcat](https://codegolf.stackexchange.com/users/52904/ceilingcat)!!!
```
i;f(char*p){for(i=0;*p++-40||p[3]-41;++i);p[-1]=p[p[1]-62?0:2];bcopy(p+4,p,strlen(p));i&&f(p+~i);}
```
[Try it online!](https://tio.run/##XVPBbsIwDP0VVAmUtKlEWbUJ4pozd26lhxG1W6UNItoDE7BfZ06cFrRLFNnP7z07jkk/jLnfW90I8/l@iq28NMeTaIu5jm2SpPn8erXlS5XmmU6SVmpbpllV2NKWWZW@Ltbz1aLSe3O0P8ImubKq609f9UFYKXU7mzUU/aWy232jOhVvy6q4RAIRZKQiASCArv5OQZQhLigOKOmgJISYQF9HYaTcExYoA1RMWOFzdHicL@dad3UZTxFUWXLAEDtXe2FKBHAIghy5HDsfziSdjEPPCWxdDn0wmJsbJNEZAW5n1HeSD68YuLmToIveHAQEjr6RO3UNAP73imwTgzUIhnHEIDAMmQLZrAwzwkFHhNmF@fuDORkN@KwJj0EMrwlMic@cMD6Fp8FhsDgM1jt/7t@x@Br3MkNH7u28qpv7TcW9/n5vD6LmZdYbWMy1PbWHvhHRtJukOJmaye5cL3bnpZma3SFSPa1nl9brLF@usvxNyov7D5N9Gfa5L7blppIVfRSKGFr3veppx7si3qu6iACjcpMkuKz07Xb/Aw "C (gcc) – Try It Online")
Takes an input string with enclosing parentheses and reduces it to either a left (`<`) or a right (`>`).
### Explanation (before some golfs)
```
i;f(char*p){                       // function taking a string parameter p  
  for(i=0;p[i++]-40||p[i+3]-41;);  // loop until we find chars '(' and ')'   
                                   // separated by 3 characters.   
                                   // since our input is enclosed in 
                                   // parentheses we will always find one.  
  p[i-1]=                          // i has gone forward one but set the 
                                   // first of these characters  - the '('  
                                   // to...     
         p[i+1]-62?                // ...depending on whether the middle   
                                   // char is a '<' or a '>'...   
                   p[i]:           // ...the one before the middle if '<'
                        p[i+2];    // ...the one after the middle if '>'  
  memcpy(p+i,p+i+4,strlen(p));     // move the back end of the string forward  
                                   // over the other 4 chars.    
                                   // now a "(A<B)" is reduced to "A"     
                                   // and a "(A>B)" is reduced to "B" 
  ~-i&&                            // if we didn't just reduce the start of p     
       f(p);                       // then recursively call f.   
                                   // otherwise p is reduced to the answer 
                                   // and we're done.     
 }  
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 15 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
O;1ị“/ṛ  ɗḷ”vØ<
```
A monadic Link accepting a list of characters\*, which yields a character.
\* Uses the encased in parens option.
**[Try it online!](https://tio.run/##AS4A0f9qZWxsef//Tzsx4buL4oCcL@G5myAgyZfhuLfigJ12w5g8////KDw8KDw@PCkp "Jelly – Try It Online")**
### How?
Converts the input to Jelly code which will reduce the pair `['<', '>']` to produce the answer. Jelly ignores spaces and has a 1-indexed and modular index-into function, `ị`, so the Link starts by converting the input characters to their ordinal values and uses `ị` to form the code:
```
input character   ordinal   indexed into "/ṛ  ɗḷ"   meaning
           (        40        (space)                 ignored
           <        60        ḷ                       yield left argument
           >        62        ṛ                       yield right argument
           )        41        ɗ                       last three links as a dyadic function
(or reduce command)  1        /                       reduce by
```
So:
```
O;1ị“/ṛ  ɗḷ”vØ< - Link: list of characters   e.g. (<>>)
O               - ordinals                        [40,60,62,62,41]
 ;1             - concatenate a one               [40,60,62,62,41,1]
    “/ṛ  ɗḷ”    - "/ṛ  ɗḷ"                        "/ṛ  ɗḷ"
   ị            - index into                      " ḷṛṛɗ/"
             Ø< - "<>"                            "<>"
            v   - evaluate with input             '>'
```
---
The example above evaluated:
```
ḷṛṛɗ/ - monadic chain (with left argument ['<', '>'])
    / - reduce (['<', '>']) by - i.e. f('<', '>'):
   ɗ  -   last three links as a dyad - i.e. g('<', '>'):
ḷ     -     yield left = '<'
  ṛ   -     yield right = '>'
 ṛ    -     (ḷ) yield right (ṛ) = '>'
```
[Answer]
# [><>](https://esolangs.org/wiki/Fish), ~~36 31~~ 30 bytes
```
>i:6%0$.
v
v~0[
v0(?o$6%?$~]
```
[Try it online!](https://tio.run/##S8sszvj/3y7TykzVQEWPi6sMiOoMornKDDTs81XMVO1V6mL//9ews7PRBAA "><> – Try It Online") [Verification of test cases](https://tio.run/##TVHNTuMwED7jp7CiotgiG1qtxCGaHV6CG0Ko27rUEsRW7FB64dW74xmnixSNPT/fjyfxnI9h/H3xHzFMWYek6i2dU5fmv3EKO5eSUruwd/qPbprmgn54uF2veqU@6fteP6vPtXkMq4fbx9X3y4VGnjfDr82LUnt30NM8vhLL27T9MH6Mc7aDujn5fNQhutG0hbjtdHtqrd4mfRj0oT9NPjtTOlbdRJL976QnPtNEsa3vQ8z3B5@OHPp41gXU9Cm@@2xsp3fbmOfJvYY5kzQxPU2z6zQboYzPTmf3tfRIcHIEGXXsU94TTqnT0b87vRni5Mdsfj6oNe0dcxh719rWWnVBBAVgAMEqg4iWckM5oKUA1gLlBqkFlkpI9ToDVAUC0IzhOgWeKTDClKNUGSoKnBCC@sQoKBaiYh2sRUIUjsIooRiiKDPIXCA2bfErg/KARQaLOIh11lSkU41hJWTLqtqir3aRDaJsoDgF/GkKxQ9WD1CdIfcRZAQFiuLK1gWUO3HIUupCOQiXTAIuOnB9ZXkL30CocOGC624ZjsvGcNkYO1XX1RuZL6te3JefwWrW/gM)
Takes input surrounded by parenthesis, and outputs a single character before terminating with an error.
### Explanation:
```
>i:           Take input and make a copy
   6%         Map the possible codepoints through modulo: EOF,<,>,(,) => 5,0,2,4,5
     0$.      Jump to that line
>             Line 0 ('<'): This just jumps back to the first line again
v             Line 2 ('>'): Does nothing and goes back to the first line again
v~0[          Line 4 ('('): Pop the extra copy of input and create a new stack
 0(?          Line 5 (')'): If the input is EOF (-1)
    o                       Output the top of stack (and error later)
     $6%                    Otherwise, check what the middle character is
        ?$                  If it is a >, swap the other two
v         ~]                Discard the right character and leave the other other one on top of the next stack
o~            Line 1 (EOF): If there is no more input, pop the copy and output the remaining character
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 17 bytes
```
“)ɗ<ḷ>ṛ( ”y;”/vØ<
```
[Try it online!](https://tio.run/##TVFLSsRQENznFC5frzyARd1jDuBmmLUwu8GN4AVmQL2BS0HFZUCYYyQXeVZ/XhBCJ91dVV3d2d8fDsfe19OrXc9Yvj65fL@0m/X0drxTuH2YL@jLz8d8afv56fd5fXzf9U5iAhoImxpJU96Ug6YAMyhvVAumElUvDFSFCMK0qCsExmni@MurQc0JkYihvhSTFYNULGAVxXANV8zghhQTw9BC2jT3m8BcYIyhD0daj5kaU75YeuF4Kld6qsvwxzyAGwX/e2LaYVlAGWP0iYQwqUxTVvv7tzTyJnXPCKmVSHDMwbakrxJfSCkOLWynDTrHwTgOFk6n7fIt8X7p4d7/RUwz@wM "Jelly – Try It Online")
Same essential approach as rak1507's APL answer. Requires the input fully parenthesized.
```
“        ”y          Replace
 )                   ) with
  ɗ                  last-three-links-as-dyad,
   <                 < with
    ḷ                return-left-argument-and-ignore-right,
     >               > with
      ṛ              return-right-argument-and-ignore-left,
       (             and ( with a space which is essentially ignored.
           ;”/       Append the reduce quick,
              v      and evaluate the result as a monad with argument
               Ø<    "<>".
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 20 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
Δ„<>3ã€…(ÿ)¬¦¨ºĆ'>ª:
```
Takes the input wrapped in parenthesis in both programs, as is allowed.
[Try it online](https://tio.run/##yy9OTMpM/f//3JRHDfNs7IwPL37UtOZRwzKNw/s1D605tOzQikO7jrSp2x1aZfX/v4aGjYadjY2mhp2GnZ2dpp2mpgaEYQdk2IAEbTQ1gfKaAA) or [verify all test cases](https://tio.run/##VVExSkNREOw9RUjje2BnJ8PkLAoWqSwEIZBAsMgBxNpGCBJygjTCi7WH@Bf57u7sy8dmeczOzszue3q@f1g@juuX1WI@G3Zvs/liNf6@D9sP8Pb8Obweh@2@nL9rO7Z9@2qnn9012@Fu3NyMhUS9KkCBPexlAGtgxTCwWrEGAikMvoG0zoUHw2FjxivRsRKsGPU5fzge4@klKzFMV5NhaHBSE0RNHddV8WhWxWLoQYGrsouqdboZPQK0RDq7WU/IVFX68GNEQvaZWanNPDT4Px8VjRkHGZLJIESixqmANS9COZS8U945ivTEBSc3TGv3H4PkOOnhcvKQYD8i@xEj8bSxK8SE/0Dfw/8oHM3qDw).
# [05AB1E (legacy)](https://github.com/Adriandmen/05AB1E/tree/fb4a2ce2bce6660e1a680a74dd61b72c945e6c3b), 20 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
'<∞©3ãε…(ÿ)}¬®Ã∞®«S:
```
Should have been 19 bytes by also using `€…(ÿ)`, but apparently there is a bug in the legacy version, so we'll have to use `ε…(ÿ)}` (or `'(ì')«`) instead.
[Try it online](https://tio.run/##MzBNTDJM/f9f3eZRx7xDK40PLz639VHDMo3D@zVrD605tO5wM0h83aHVwVb//2to2GjY2dhoathp2NnZadppampAGHZAhg1I0EZTEyivCQA) or [verify all test cases](https://tio.run/##VVFBSgNBELz7ipBLZsCDIl6kqDzCF0TwC0JAQRBCznlALoIQDLl5FnbvecR@ZO3u6snipRmqq6uqe27uV0@3z@Pry3o5nw2b3Wy@XI8LDNt9d7jrP88/w/tX6X/rW3fsTv2H46fu@/FhvB4LiXpVgAJ72MsA1sCKYWC1Yg0EUhh8A2mdCw@Gw8aMV6JjJVgx6nP@cDzG00tWYpiuJsPQ4KQmiJo6rqvi0ayKxdCDAldlF1XrNDN6BGiJdHazlpCpqvThx4iE7DOzUpt5aPB/PioaMw4yJJNBiESNUwFrXoRyKHmnvHMU6YkLTm6Y1m4/Bslx0sPl5CHBdkS2I0biaWNXiAn/gbaH/1E4mtUf).
**Explanation:**
```
Δ                     # Continue until it no longer changes, using the (implicit) input:
 „<>                  #  Push string "<>"
    3ã                #  Create all possible triplets of these two characters:
                      #   ["<<<","<<>","<><","<>>","><<","><>",">><",">>>"]
      €               #  Map over each string in the list
       …(ÿ)           #   And wrap it in parenthesis
           ¬          #  Get the first item (without popping the list): "(<<<)"
            ¦¨        #  Remove its first/last characters: "<<<"
              º       #  Mirror it: "<<<>>>"
               Ć      #  Enclose; appending its own head: "<<<>>><"
                '>ª  '#  Convert it to a list of characters, and append ">":
                      #   ["<","<","<",">",">",">","<",">"]
                   :  #  Replace all ["(<<<)",...,"(>>>)"] with ["<",...,">"]
                      # (after the loop, the result is output implicitly)
'<∞                  '# Push "<" and mirror it to "<>"
   ©                  # Store this string in variable `®` (without popping)
    3ãε…(ÿ)}¬         # Same as above
             ®Ã       # Only keep the characters that are also in `®`, removing the "()"
               ∞      # Mirror it: "<<<>>>"
                ®«    # Append `®`: "<<<>>><>"
                  S   # Convert it to a list of characters:
                      #  ["<","<","<",">",">",">","<",">"]
                   :  # Keep replacing all ["(<<<)",...,"(>>>)"] with ["<",...,">"]
                      # until there is nothing more to replace
                      # (after which the result is output implicitly)
```
[Answer]
# JavaScript (ES6), ~~69~~ 67 bytes
*Saved 2 bytes thanks to @Neil*
```
f=s=>s<(s=s.replace(/.?([<>]{3}).?/,(_,s)=>s[s[1]>'<'?2:0]))?f(s):s
```
[Try it online!](https://tio.run/##fVLLbsIwELz3K1AueCUa@rihZXLqV6RRFdFQFUUEYcql6ren610HFWH3skrsmdnx7O7ac@s3x8/D6X4/vHfjuF37NTw7v/blsTv07aZzy7JyNaP5fv6hslou3NvCk6BqXz82mPO8elo9NETV1nla@XEz7P3Qd2U/fLji5dz2X@2p87PTMOOC7v7ebl0ByOHNKbNjMCVuHABKcpxwGCSFiTiJcBA6k4AgyKwOC46ljeg4RUpRVpBO6oaLgFN5864/opFkiA9TVsMCi9R4KBrpPsGHlfBUqcaC9mMLgNLZGNXim8whWGYLZXJ6RS1e91cDxO0AxX02EkSbGl/6QdAMOOKRCQs21ZAa4/@AYNkg5sExJWQYYCPB5GEJURwh0o5cHHRcJC3Wz7iMvDu@zClkr19s7ZDvx5ed0haYtgDTFuiL8wmHDqoQVmzKJSyhOtKVGX8B "JavaScript (Node.js) – Try It Online")
[Answer]
# PCRE, 52 bytes
```
(((<|>|\((?3){3}\))(?=(?>(?4))?>)(?3))?(\((?1))?)(.)
```
[Try it online!](https://tio.run/##VVGxTgNRDNv5DoYEiZ5Q6WZ8P9KVAamiJ8qARPl1jiTO64nlKXIc28lbXj9Oh/UyrWaGK69Hs3nv3/ufo7vNLzbT5mf3mZ64z5aEpyjcdr7uHqb7w/S1Ggm/M8AQRVQB0AuzwBDTQDRQiLH4ATI6Nx4CR4wFz6oTT7FqNOeySLzG20tWYoSuJssw4KY2CG@d1NWT0eIVi6UHBXZlF1XrDDNmBGiJdk6zkZCtqvTlx4qE7rOzUptlaPB/PioaOw46JJtBiESNUwG9L0I5WN@p71yP9MQFNzdsa48fg@S46eF28pLgOCLHESvxtnEq1ET@wNgj/6gcw@r3vHy@nd8v6@Ny@gM "Perl 5 – Try It Online") Link includes Perl 5 test harness. Does not take outer parentheses (admittedly a version that takes outer parentheses would probably be shorter.) The desired result is captured in group 5. Explanation: Group 3 matches an operator. Group 2 matches two operators, but only if the second operator evaluates to `>`; a recursive atomic match is used to determine whether that is true. Group 4 then recurses if the current operator is an expression.
```
(               Group 1 is:
 (              Group 2, which is:
  (             Group 3, which is either:
   <|>|         ... a literal `<` or `>` or...
   \((?3){3}\)  ... three recursive matches of group 3 inside parentheses;
  )
  (?=           Followed by a lookahead to:
   (?>(?4))?    An optional atomic recursive match of group 4...
   >            ... which must be followed by a `>`;
  )
  (?3)          Followed by another recursive match of group 3.
 )?             Group 2 is optional.
 (              Group 4, which is...
  \(            ... a literal `(`...
  (?1)          ... followed by a recursive match of group 1.
 )?             Group 4 is optional.
)               End of group 1.
(.)             Group 5 then captures the desired result.
```
[Answer]
# [C (gcc)](https://gcc.gnu.org/) (no builtins), ~~147~~ 143 bytes
*4 bytes saved thanks to [ceilingcat](https://codegolf.stackexchange.com/users/52904/ceilingcat)!*
```
i,m,c,q,w;f(char*s){for(i=m=w=0;c=s[i]%9;i++)if(c-1?c-4?w+=w-~c%3,++m==4:(q=i,m=w=0):0)for(s[q]=w-2&&w<9?62:60;q++<i;)s[q]=1;s=*s%3-1?*s:f(s);}
```
[Try it online!](https://tio.run/##dVRdb@IwEHzPr9imotgkPeiHKpXYRtWplU466Sq1b4WHNDjFuhAgDqK6qvfXuV070F4BCYXgnZkdzxpnpy9Ztl6beBpn8SJeJTnLJmnVsfwtn1XMyKlcyV6SSftkRq3rxEQRN4g5PRtkp5eDVSRXp3@z1kUcRVMpL/tsIVGLOLzf4yRhnxYjBJ2fnKzE9eDqvH/VSxZRJEzCXekssbJjWxeo2LH9nFmevK@PTZkVy7EGYeuxmX2bqOC/pcI801rgvIKtq1@Nb3xPaw5vAYApayh0CRJ6Cf5cTUyhGZWfcHXEqRZFVPHESluETtOimGXMmj965iU5dAjKCekiQVnjRPFLUAlfMBUSwIyw4nqYEREqXS@rkkpJ8B4ExM1TU3yfLfHNGQuOxzo3pYbH24dHZmPQr2gfhkjeOKunc6dKm8R0oNuBl7Se6ApSmC7r9LnQVDXlC3S6n5jNlnKGAkjzBRweLR9J12hrBpNoAHMUqnMWPmpbo2QfhmHLDsNhefs611mtx31ot7L2sLzJ6mVabH5JBQgrwxjcHmJqTi8gpfMxgPD@5uEhhD6Edzc/foZbR3ml9dZiE9I0NSUwmmO324Rwts0gZIIpIbjiwx7KBIjBQUg4i0FRqEEwX9aWhRJb3xQF2MlsWYzhWUNbtNGPJJKLO2RKCY6esfCxJgQTuLyzjmDF9@DRjhCK4wNJYk@dKdcHIQpxBzRwT9hWcdRgDtfs0cvuatIyoZx049hb3IdHB17VGUVQQ2wWBd/bgxz4B22QU@7EUa6X8Nvm@/LwRB/YxpYis8JH8b/Hw/NSX@dF1omndrJQjUef2i7GJYOfBq34Doas@bQpLKE@5/JFy49b@fE0HOFb7MEr4SnKSysfDG9mpvZ5Yc1cmzPjHr6XZwp1yJf4GMzmZArfSh3qJbbHx8mrzdDVZuhup4cyJXXHp9O0SYPOm3PDP/Hoj4p3XVrg9aSz3/hXz9n2BvKX9sf9c4cFPYaWgRpvIrz4jtzt8oGnG1UXVm947gzdp9YiC29xR7NHocPhZ/0P "C (gcc) – Try It Online")
Function that takes a null-terminated `char` array as input, and returns a `char` (`int`).
Here's a visualization of how it works:
```
(((>>>)<<)(<(<><)<)((<<(<<<))>(>(><>)<)))
((>....<<)(<<....<)((<<<....)>(>>....<)))
(>........<........(<........><........))
(>........<........<....................)
>........................................
```
(In the code, it uses 0x01 instead of `.`, but due to the modulus, they're equivalent even in data representation.)
Essentially it scans the code looking for instances of `(data)`, where `data` consists of substring of 3 characters, except `'.'` and `'('`. (4, in the code, since it tracks the `)` as the 4th character.) The program keeps track of the start of this string (`q`) and a binary representation of the visited characters (`w`). If we consider `'>'` to be equivalent to the binary `1`, and `'<'` the binary `0`, we simply look at a table of what the results of the binary strings should be. As it turns out, for `q=1,4,5,6`, the answer is `'<'`, and `'>'` otherwise. Thus, `w-1&&w<5` is a sufficient determiner. (In fact, since we keep track of `)` as part of this binary string, we have to consider that everything is doubled, and for no byte cost, we can modify this formula to obtain the `w-2&&w<9`.)
After we determine what the result should be, we replace the initial `(` with the result, and all subsequent characters with `.`. Then, so long as the initial character of the string is `(`, we repeat our function. This allows us to skip moving the string around, which, in my head, should save bytes, but I haven't tested the alternative.
Started working on this before I saw the [existing (much shorter) C answer](https://codegolf.stackexchange.com/a/218650/31957). But I enjoyed this nonetheless.
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~51~~ ~~49~~ 44 bytes
-1 byte thanks to [Neil](https://codegolf.stackexchange.com/users/17602/neil)! (match any character `.` instead of the opening bracket `\(`)  
-4 bytes thanks to [Dingus](https://codegolf.stackexchange.com/users/92901/dingus)! (`String#sub!` returns `nil` if there was no match)
Outputs by modifying the input. This would be 43 bytes with [tsh's regex](https://codegolf.stackexchange.com/a/218620/64121).
```
->s{s.sub!(/.((.)<.|.>(.))\)/,'\2\3')&&redo}
```
[Try it online!](https://tio.run/##TVHRSsNAEHzPV8Qq7S1oCvq6nR8xItSmVqi29BpEar89zu5eghD2bvdmZmc3p379M2xX7fCAfMlN7tc3admk1Ig2vw14SivL@0X72D4tZD4/dZvDdfjefey7@r0756qu82qWbi93r83b7vB5vMqMte1zfuFx7M@5zlX3tRkArVSTQqVKAIR5Yq4QBhVR5gl8UmEJrBeMsqokEJO8zuAYo5Fjh1WdGh08IYPvVAyWN2KxAEuRDNMwxQhmiDEwcC0Nm2J@AxgDjG1gzTWse0@2Kb5Q9NxxVVzxK69wf4gFmFHFf08IOygWtBiDv0MDgqAiTEmZ3@7UiJ2UfXoIrUAqxj46DWmj@E1DCqOWTqt1OsaFYVyYO62mzafA26ZH9/YvvJvIHw "Ruby – Try It Online")
---
# [Ruby](https://www.ruby-lang.org/) `-p`, ~~40~~ ~~39~~ 38 bytes
-1 byte thanks to [Sisyphus](https://codegolf.stackexchange.com/users/48931/sisyphus)!
```
sub /.((.)<.|.>(.))\)/,'\2\3'while/../
```
[Try it online!](https://tio.run/##VVHLasMwELz3KwQ9RIJWhva6zJf40gSXGBzb@EEI9Nur7ksxvazEaHZmdrXs50e5XKfbHF7D2F26df1aHuF7WsJtH7Z@HrrQj/O@rWXdz6HJMeZE@SeDz9Sm5u3UfrSfp/u1H7om56aUCFB6iUSR@MI3BpAUi4wREhd@IEUilM8g@OXJI8aJ25gX9YWLsrRV@uQiuLa7l1kZg3WtUw0ZdqqDlFxHdK1INK7GguqRBU6W3ag2TjWDRCAbwp3FrCaEq1p69YNGIn@HZ4VNJqEJ//PBosHjkIeEM0BGgrXDAibfCMwh@p58z1pMz7iEw42OseuPkcnh0KPnylUCdYmoS9TEx8SioB3yA3UO@SN1ZKvfad76aVzL@/wH "Ruby – Try It Online")
[Answer]
# [><>](https://esolangs.org/wiki/Fish), ~~22~~ 20 bytes
*-2 bytes thanks to Jo King*
```
i:2%?\
?$~$~\0(?o$6%
```
[Try it online!](https://tio.run/##S8sszvj/P9PKSNU@hstepU6lLsZAwz5fxUz1/38NOzsbTQA "><> – Try It Online") or [verify all test cases](https://tio.run/##TZHBTsMwDIbP5CmialNjMQoDicNkvJfgxhCCrWiVRhM1qcYuvPpw7HQgTV7s/L/9xQ2ntPf9w7n7Cn5I1kdTTvEUF3H8CIPftjEas/W71j7Zoaqqc7e6n683Zj37mf1s7tzazx7nZ754Wa5ulq/GHPfdobXLlbnyoe1dnb31wtbHGprj0KXW5QqYqzB0fXJ/Y5ph7F0VlMne@pBuP7u4l9CEk822qonh0CUHC7t9D2kc2jc/pjAmpnsexnZhu16z2tXXcnZwXQMDpPZ7UkET0459YM5EaBAdEoJxRAScO86RgAMCIOeO@AqBS8T1okGuIhtY46TOQTTZxp78l6ti1QmSsIPvuaO6ZBAXi7AU2ZF75I4aMhBH1ZD0QsWEzKtCfcA0hvJwVHSZaXhOAaPSUJBNweJfuSUBJN1AJkX6D0XKQ4UBCxnJPaFKSK2kVFAWkM/cQ5dSFipBe6kSaZqDl1fmt8gJtRVNvfCyW7HTtDGaNiak5rJ6p/q86ok@fwyZBvAL)
## Explanation
```
i:2%?\              main loop:
i                     Read a character from the input and push it onto the stack
 :2%?                 If it's not a multiple of two (")" or EOF),
     \                  Swap to the branch
                      IP wraps around, repeat
?$~$~\0(?o$6%       branch:
     \                Entrance
      0(?             If the character is less than 0 (EOF),
         o$             Output the result and error
                      Otherwise,
          $             Check the middle value
?          6%           If it's not a multiple of 6 (">"), [the IP wraps around]
 $         $              Reverse the other two values
  ~                     Pop the right value
   $~                   Remove the "(" from the stack
     \                  Return to the main loop 
```
[Answer]
# [Stax](https://github.com/tomtheisen/stax), 23 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
ü▼2δ`▀ÆH╞íq`º╪ ≈♀ô☺ßX→ú
```
[Run and debug it](https://staxlang.xyz/#p=811f32eb60df9248c6a17160a7d820f70c9301e1581aa3&i=%28%3E%3E%3C%29%0A%28%3C%3C%28%3C%3E%3C%29%29%0A%28%28%3E%3E%3E%29%3E%3C%29%0A%28%28%3C%28%3C%3C%3E%29%28%3C%3C%3C%29%29%3C%3C%29%0A%28%28%28%3E%28%3E%3E%3C%29%3E%29%28%3E%3C%3E%29%3E%29%3E%3C%29%0A%28%28%3C%3C%28%3E%28%3C%3E%3E%29%3C%29%29%28%28%3E%3C%3E%29%28%3E%3C%3C%29%3E%29%28%3C%3C%3C%29%29%0A%28%28%28%3C%3C%3C%29%3C%3E%29%28%28%3E%3E%3C%29%3C%28%3C%3E%3C%29%29%28%28%3E%3E%3E%29%3C%3C%29%29%0A%28%3E%28%3E%28%28%3E%3C%3E%29%3C%3E%29%28%3C%3E%3E%29%29%28%28%3E%3E%3C%29%28%28%3E%3C%3E%29%3C%3C%29%3C%29%29%0A%28%28%28%3E%3C%3C%29%28%3E%3C%3C%29%28%3C%3C%3E%29%29%28%3C%28%3E%3E%3C%29%28%3E%3E%3C%29%29%28%3C%3C%28%3C%3C%3E%29%29%29%0A%28%28%3C%28%3E%3C%3C%29%28%3E%28%3E%3E%3E%29%3E%29%29%28%28%3E%3E%3E%29%3E%3E%29%28%28%3C%3E%28%3E%3E%3C%29%29%3C%3C%29%29%0A%28%3C%3E%3E%29%0A%28%28%28%3C%3C%3C%29%3E%28%3C%3C%3E%29%29%28%3E%3C%3C%29%3E%29%0A%28%28%28%3E%3E%3E%29%3C%3E%29%3C%28%28%3C%3C%3C%29%3E%3E%29%29%0A%28%3E%28%3E%3E%28%3C%3C%3C%29%29%28%3E%28%28%3C%3E%3E%29%3C%3C%29%3C%29%29%0A%28%28%28%3E%3C%3E%29%28%3C%3C%3E%29%3E%29%28%3C%3C%28%3C%3C%3C%29%29%28%3C%28%3E%3E%3E%29%3C%29%29%0A%28%28%3E%3C%28%28%3E%3C%3E%29%3E%3C%29%29%28%3E%28%3E%3E%28%3E%3E%3E%29%29%28%3C%3E%3C%29%29%28%3E%3E%3E%29%29%0A%28%28%28%28%3E%3E%3C%29%3C%3E%29%28%3E%3C%3E%29%28%3E%3C%3E%29%29%28%3C%3C%28%3C%3E%3E%29%29%28%3C%3C%3E%29%29%0A%28%28%28%3E%3C%3E%29%3C%28%3C%3C%28%3C%3C%3E%29%29%29%28%28%3C%28%3C%3C%3E%29%3C%29%28%3C%3E%3C%29%3E%29%28%3E%3E%3E%29%29%0A%28%28%3C%3C%28%3C%3E%3C%29%29%28%28%28%3C%3E%3E%29%3E%3C%29%28%3E%3C%3C%29%28%3E%3C%3E%29%29%28%3C%28%3E%3C%3E%29%3E%29%29%0A%28%28%28%3E%3E%3E%29%3C%3C%29%28%3C%28%3C%3E%3C%29%3C%29%28%28%3C%3C%28%3C%3C%3C%29%29%3E%28%3E%28%3E%3C%3E%29%3C%29%29%29&a=1&m=2)
Uses the same regex as tsh's Javascript solution, and replaces till a fixed point is reached.
## Explanation
```
"\((.>)?(.)(<.)?\)".$2RgiH
                       g   generator:
                        i  apply the following till invariant:
"\((.>)?(.)(<.)?\)".$2     regex replace with second capture group
                         H take last generated value
```
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 54 bytes
```
#//._[a___,"(",b_,c_,d_,")",e___]->a.If[c=="<",b,d].e&
```
[Try it online!](https://tio.run/##ZVFBisMwDLz3GQkUG9z0A8pQ2NPeFnoMwXjThPbQHrK5Le3Xs7JkJw17EbY0mhlJ9zBd@3uYbl2Yh3ouj8fKN8F77wpTuG/vOu8u/LGF6znbHhCqz6Hp6rogrrtLW/X7@Wu8PaamPGA4fVzDGLqpH39OZbt/nbvweP3uCgMQc/CDyBC/9cNp2FwxXCFYDlymnDSQXs6Di@9o4hJxP6ONFDkIUAhSd3zHkpAkaZVdQCyg/SLOlYROSbIrWxTQEJ1yVCCEldS/XaZRtM6YVRG9kM60Woiqb4aR6HWerA1xSAmC1T104jgG4Z9jqFkkg5RsYwWBFAclgVq2aVlYpEzaYrqFBGVVOGEjS@tG8m1JSbFhpeUsQoS8YuQVi/vNGiKPNMUr5bHiHUU3nmD3nP8A "Wolfram Language (Mathematica) – Try It Online")
Input a list of characters.
[Answer]
# [Python 3.8 (pre-release)](https://docs.python.org/3.8/), 73 bytes
```
f=lambda s:~(q:=s.rfind('('))and f(s[:q]+s[q+ord(s[q+2])-59]+s[q+5:])or s
```
[Try it online!](https://tio.run/##TVLRasMwDHz3V5hCqUVZHzYKW1D1IyUPHWlYIEvTOC972a9nJ8kJK0WJz3fS@eLxZ/56DG/v47Qs7aW/fX82t5ir3/SsLvk0td3QpEM6EN2GJrYpX6tnfczX5/ExNUmfrzW9nD8cO1c1PaaYlxa174Z77Ia42@2CCAfmxMIUkogQ1glrFkJhIsY6CbaYAAnwwmGgDAE4yXAU46gMGn0oalKfYAsosI@OrrJBAAuxgFBoD@3oRQ2hOkesF7tNUr9O9AOsY0SHs1u3mQFzijEpDc1yKLbwL7tiBsUTUKcs/02J@5HigYszsX1hp4hLxV1RCUDf0cNDKYFa8V7OZFnn8HZKPYu9sbeStRdv2Zpc1sRkTcychi365HyNenWvH8OmIUxcilMe@27WW5ITVSHi17V2a6o4Tt0wpxY3b5/psFcQIqXc@7ztG7z8AQ "Python 3.8 (pre-release) – Try It Online")
# [Python 3](https://docs.python.org/3/), 77 bytes
```
def f(s):q=s.rfind('(');return~q and f(s[:q]+s[q+ord(s[q+2])-59]+s[q+5:])or s
```
[Try it online!](https://tio.run/##TVJBasMwELzrFSIQoiU0h5Yc6mz3IyGHgm1qCEpsuYde@nV3dlc2DWFtjWZ2R2M9f@avR35blrbrY58KNeNHOU39kNt0SAe6TN38PeXfMX7mVgnXZrwdy3U8PqY26fP1Ri/nd8fOzY0eUyxLj3ofcheHHHe7XRDhwJxYmEISEcI6Yc1CKEzEWCfBFhMgAV45DJQhACcZjmIclUGjD0VN6hNsAQX20dFVNghgJVYQCu2hHb2oIVTniPVit0nq14l@gHWM6HB26zYzYE41JrWhWQ7VFv51V8ygeALqlOW/KXE/Uj1wdSa2L@wUcam4K6oB6Dt6eCg1UCvey5ks6xzeTqlnsTf2VrL24i1bk8uamKyJmdOwRZ@cr1Gv7vVj2DSEiUtxKs/7MOstKYmaEPEbers1TXxOQ55Tjyu4L3TYKwiRUrp72fYNXv4A "Python 3 – Try It Online")
Solution without regex. Requires the whole input be parenthesized.
-1 byte thanks to ovs
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 27 bytes
```
Ｆ⁻Ｓ(≡ι)«≔⊟υθ≡⊟υ>§≔υ±¹θ»⊞υιυ
```
[Try it online!](https://tio.run/##NY7BCoMwEETP5itCTrvQHnrVEPDooUXoF4QYNSDRmqQtFL89XRHZyzAzbxkz6tXMesq5n1cOd@dTgMYvKT7j6vwAeOECBCIPHxfNyMEh/zGjg@UCRUm6qENwg4d2XiBR/YUVK872Ye5IcTCKmAOoY@M7@4V04Q876GjhdtIb21hne52mWPI2hXEvOUo21tKqSC@rnAFAKYVSIkiQSiIJkCTJQQV0klJEzNf39Ac "Charcoal – Try It Online") Link is to verbose version of code. Takes input wrapped in `()`s. Explanation: Port of @2x-1's answer.
```
Ｆ⁻Ｓ(
```
Remove `(`s from the input and loop over the remaining characters.
```
≡ι)«
```
If the current character is a `)` then...
```
≔⊟υθ
```
... pop the last character from the stack; and ...
```
≡⊟υ>
```
... if the (second) last character was a `>` then...
```
§≔υ±¹θ
```
... overwrite the (third) last character with the originally popped character.
```
»⊞υι
```
Otherwise push the current character to the stack.
```
υ
```
Print the final remaining character.
[Answer]
# [Java (JDK)](http://jdk.java.net/), 76 bytes
```
s->{while(s.length()>1)s=s.replaceAll("\\((.>)?(.)(<.)?\\)","$2");return s;}
```
[Try it online!](https://tio.run/##VZFNb9swDIbv@RWCsQO5tgK248Ky2GW3nXpcdvBSJ3Wm2IYlZyiK/HaNIuVgAwx9kC9fPqJP7aV9OL38zv15GufkTnL3S@qDPyzDPvXj4D9uN/vQxui@t/3g3jfOTcuv0O9dTG2S7TL2L@4sOXhOcz8cf/x07XyMqFLnvlUfsuy9s53dwT3m@MDvf1770EH0oRuO6RWQP2F8jH7uptDuu68hQLPbAXjGJ/AI5PFpt8PmvvnwucHt3KVlHlzcXvNW@x3G2cGlnQvEl/9InHt@i6k7@3FJfhKIFAY4@Haawhs00NyJ@K7BBtGcrrpuyuGaMzNlIiAmzMDMKHeQO7EwESGS3IElRSghlnjVkERJCkQDGpdFNaVMaspWolpqHfQiFZIXR6vSRhKswhqUiuJRHG0pQLKahtWLDBMLrwntAWsbLs3J0LWntKlcXP2UOFcq@WqWlY9tAAWU@F8mNhyuCFTBWPNMJmErZYPC@v5yFg@bSZ2nLuZlSuK1D90eWZ6iJzIrXr3oNlot53VgvA5MSfNt8mD6MumVvvwL7Yb4Fw "Java (JDK) – Try It Online")
## Credits
* -16 bytes thanks to [Kevin Cruijssen](https://codegolf.stackexchange.com/users/52210/kevin-cruijssen) by porting [tsh](https://codegolf.stackexchange.com/users/44718/tsh)'s [JavaScript answer's regex](https://codegolf.stackexchange.com/a/218620/52210)
[Answer]
# [Julia](http://julialang.org/), 61 bytes
using [tsh's regex](https://codegolf.stackexchange.com/a/218620/98541)
```
f(x,y=replace(x,r"\((.>)?(.)(<.)?\)"=>s"\2"))=x==y ? x : f(y)
```
[Try it online!](https://tio.run/##TVLLasNADLz7K8SepBAC7bHIkx/xJbQOuBg32C44X@/qsQ4NYbOSRqPZib5/x@H2tu37nbfzs537x3j77O0@l475ArnyRVgvcu2ktFhK915E2q1tn3SljT7ozk/Z135ZF2qplNIA2qiyQqVhAGIxW6wwIlURtZhhJRVLwfIVo5ZVazAMR96OwHib9fiPZ6M1J0RgHVY3xuyKQZaswJq0DudwxjxckJ2JQXBpyhTXm8B8wDEGPlxTesy0MVUXKl8obqoq@9YqQh/SABeq@K8JKQdVglZhiDo0IchWpCip7/e7caQn1c84kiuRimOOvh7pT4mbJhUOLn1ZG@04DMNhWChtXs5z4t3pQ73/FzHNvPSdaO4/M/mS0DDR8hiHlWNlpCH7RMGWhwudMjhRkRK1xzxM6zgF/EylMyConG3tPGP0/fS1/wE "Julia 1.0 – Try It Online")
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), 27 bytes
```
'\((.>)?(.)(<.)?\)'⎕R'\2'⍣≡
```
[Try it online!](https://tio.run/##VZAxDsIwDEX3noLN9tAOzNbvHZi7VEKwVIKVCyAxgFg4AOJmuUhrO0lVqshJnO/v547XqT3exulynudTur9pYO4gPXfC2kk/CKXX50DDntLzlx5fk@2IARVq/MSqDFZAVIQZCrGgYpvaVlWRy0FNYjE8IngqZ1fPIrdnCMLXD@ZpnXJN9m6o3Xx293KHqW2dAaVlxlqBHNlW0UA2A2lQcTihcqNyazD9@fhYUaWSDRwPPoDGjxFaAA "APL (Dyalog Unicode) – Try It Online")
This is longer than rak1507's [answer](https://codegolf.stackexchange.com/a/218621/95792), but I just wanted to use a different approach. Uses the same regex as everyone else.
[Answer]
# [Pip](https://github.com/dloscutoff/pip), 24 bytes
```
L#aaR:`\((...)\)`B@A@>Ba
```
[Try it online!](https://tio.run/##ZVExbgJBDOx5BYJmt8g9AI1GQB0aWojElZFS0Ed5@2J7vLec0li79nhmbD@/n@23fe7n@Xp43EuZpqne6@N8PB15ntvf9rK5bba7QqLu/AEU2FsfS7P2SrEKWC1YGT1ZGL2WpxXf0bASrN/QJYoWAhgE2e1vLwVJSkt2AZmA@kPcKonOJOpgcwEFd2pRQAYr5L8u0witGbsq3Qs007Dgqm@GmfSap2szHCIhHO6piX0M8J9jyizTINI2B4gQjiKhLNdcFhepklvMW0QQq@DgShZjI/22EClXrFjOEkTsK2ZfcbhfrcF5osmv1MfyO4ZunOCrtY@fFw "Pip – Try It Online")
### Explanation
This one is a regex replacement solution:
```
L#aaR:`\((...)\)`B@A@>Ba
                          a is command-line argument
L#a                       Do the following len(a) times:
   aR:                     In a, replace (and assign back to a)
      `         `          this regex:
       \(                   Literal open paren
         (...)              Three characters (captured in group 1)
              \)            Literal close paren
                           with the result of the following callback function:
                    @>      All but the first character of
                      B     capture group 1
                   A        ASCII code of (the first character of) that string
                 B@         Use that value to index cyclically into group 1
                       a  After the loop, output the value of a
```
The replacement works because the charcode of `<` is 60 and the charcode of `>` is 62. Using those values as modular 0-based indices into a three-character string gives the first character and the last character, respectively--exactly what we need.
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 25 bytes
```
u:G."(\‹Kž%
<—åkí2""\\2
```
[Try it online!](https://tio.run/##K6gsyfj/v9TKXU9JI4bpULf3oXmqPDYsh6YfXpp9eK2RklJMjNH//0oadho2NnaaNppKAA "Pyth – Try It Online")
---
Uses the regex from [tsh](https://codegolf.stackexchange.com/users/44718/tsh)['s Javascript answer](https://codegolf.stackexchange.com/questions/218618/evaluate-left-or-right/218620#218620). Replaces each match with its second matching group until a fixed point is found and printed.
[Answer]
# [sed -r 4.2.2](https://www.gnu.org/software/sed/), 27
Using the same regex as everyone else:
```
:
s/\((.>)?(.)(<.)?\)/\2/
t
```
[Try it online!](https://tio.run/##VVExbsNADNv9EmmoDWQMCOYjHtuhS1LUeX@vkqiLkUU4UBRJ6Y6vzzGuy7HtZiv9ZqsbVr/tvu2XbXmOYSR8McAQj3gFQC/MAgNjANFAIcbiB8jovHgIHDEWPKtOlGLVaM7lI/Eaby9ZiRG6mizDgJvaILx1Ulclo0UVi6UHBXZlF1XrTDNmBGgJOS/lNiOyZRW/DFmZ0H12WGq1TA2@B6SysfOgU7IZhEjUOJXQ@ySUg/Wh@tBVpCcueLrh3Ht@GSTHUw@vm5cE5xU5r1iJz41ToSbyC@Ye@UnlGFZ/j5/n9@N@jI/ffw "sed 4.2.2 – Try It Online")
[Answer]
# [Pip](https://github.com/dloscutoff/pip), 27 bytes
```
VaR^"<>"''._R'("({bQ'<?ac}"
```
Takes input with outer parentheses. Verify all test cases: [Try it online!](https://tio.run/##ZVGxTkMxDNz7FVWWlwzwBafjCxjowIIAFSYkhu5Vvz3YPifpE4uV2Oe7s335ufRrfz2fPgpYtu3x87TVUq9fLxuezt@30m/H58Pb4VgqiVb8AVTYWx9Ls41KtQrYLFgZI1kZvZanFe/RsBKs39A1ihYCGATZ7W8vBUlKS3aCTED9IW6VRGcSbbG5gII7tSgggxXy3@Y0QmvGoUr3As20LLjqnWEmveYZ2gyHSAiXe2piHwP855gyyzSItM0FIoSjSCjLLZfFKVVzi3mLCGIVHNzJYm1k3BYi5Y4V8yxBxLFijhWH@90anCea/EpjLL9j6MYJ3nt/@O2T/A8 "Pip – Try It Online")
### Explanation
Translates the input into a Pip expression and evaluates it. In Pip, function call syntax is `(f a b c)`, so all we have to do is quote the angle brackets and insert an appropriate function inside each opening parenthesis:
```
 a                           Command-line input
  R                          Replace
   ^"<>"                      either of < and > with
        ''._                  itself with a single quote prepended
            R                Replace
             '(               open parenthesis with
               "(         "   open parenthesis followed by a string representation of
                 {       }    this function:
                  bQ'<?        If the second argument is equal to <
                       a        then return the first argument
                        c       else return the third argument
V                            Evaluate as Pip code
```
]