Sum over an Interval Inspired by this challenge, and similar to this and this.
After seeing these, I figured I would continue the trend as there was no inclusive/exclusive sum.
The goal here is to sum an interval of integers, either inclusive and exclusive, and output the total to stdout.
Input format: either a ( or [ followed by 2 comma separated integers followed by a ) or ]. Ex: [a, b] (a, b] [a, b) (a, b)

Note: b &gt; a &gt;= 0 and the range will always contain at least 1 value.
Input regex: [\(\[]\d+,\d+[\)\]]

Examples:
Input -&gt; Output

[2,6] -&gt; 20
(15,25] -&gt; 205
[0,16) -&gt; 120
(15,20) -&gt; 70
[1,2) -&gt; 1
(2,12] -&gt; 75
[11,16] -&gt; 81
(15,29) -&gt; 286
[14,15) -&gt; 14
(2,16] -&gt; 133
(12,18) -&gt; 75

This is code-golf, so the shortest code in bytes wins.
Jelly, 14 bytes
ḊṖVr/ḟ×ɗċⱮØ($S

A monadic Link accepting a list of characters that yields the sum of the described range.
Try it online! Or see the test-suite.
How?
ḊṖVr/ḟ×ɗċⱮØ($S - Link: list of characters, R  e.g. &quot;[5,8)&quot;
Ḋ              - dequeue                           &quot;5,8)&quot;
 Ṗ             - pop                               &quot;5,8&quot;
  V            - evaluate as Jelly                 [5,8]
                 (call that X)
            $  - last two links as a monad - f(R):
          Ø(   -   list of characters = &quot;()&quot;       &quot;()&quot;
         Ɱ     -   map across these with:
        ċ      -     count ocuurences (in R)       [0,1]
                     (call that Y)
       ɗ       - last three links as a dyad - f(X,Y):
    /          -   reduce (X) with:
   r           -     inclusive range               [5,6,7,8]
      ×        -   (X) multiply (Y) (vectorises)   [0,8]
     ḟ         -   filter discard                  [5,6,7]
             S - sum                               18