[Question]
  [
# Task
Given a string composed of ASCII printable characters, return how many strings could fit the given pattern with character literals and regex-like ranges.
# Pattern string
The pattern string follows this grammar (the | means an option and the \* means 0 or more occurrences of whatever was immediately to the left):
```
pattern := '' | pattern_string
pattern_string := (SAFE_CHAR | ASCII_RANGE) pattern_string*
ASCII_RANGE := '[' CHAR '-' CHAR ']'
```
where `CHAR` is any ASCII character in the range `[32, 127]` and `SAFE_CHAR` is any `CHAR` except the three characters `[`, `-` and `]`.
## Examples
Examples of pattern strings would be `a`, `[0-*]4fj`, `[a-z][4-9]D[d-B]`.
# Input
The pattern string. You can assume all ranges are well-formed and that all the second characters in the ranges have their ASCII codepoints `>=` than the corresponding first characters in the range.
# Output
The integer corresponding to the number of strings that match the given pattern string.
# Test cases
```
"" -> 1
"a" -> 1
"[*-0]" -> 7
"[0-9][0-9]" -> 100
"[a-z]d[A-z]" -> 1508
"[<->]" -> 3
"[!-&]" -> 6
"[d-z]abf[d-z]fg" -> 529
"[[-]]" -> 3
"[a-a][b-b]cde[---]" -> 1
"[0-1][0-1][0-1][0-1][0-1][0-1][0-1][0-1][0-1][0-1][0-1][0-1]" -> 4096
"[--[][--]]" -> 2303
"[[-[].[]-]]" -> 1
```
You can check [this Python reference implementation](https://tio.run/##nVLLboMwELznK7YcmkDZCtRTo4LU73CsiIdpkFxAtlHVRvl2un5Qcu5lZj07Hi8rpm9zGYeXZWlFB804D@ag4@MO4HOWpp9kLxQUkJPwdemlAG17AH0HmmUcigL2bO81gHMKjUwdKUeJpsuaHXkwjKqlPqENJTo0Mk59oeLgoWhrg9L51miASfU0nM3fvHdDJoXPRX/7yc0MIKQWa4YfJqdpSFDCzGq4S1iM0ObcVFpYHyNLFKUWK08swYyHMsNX7iCcK/zhLXsnDMIblmv5gI9r2ZKhqjvH3UcQGfItpuKsxpo3rWCIuD2X839CSEBknODvJUbnZ8atsKN1dKMC@/nQD7Ctwe7Nb72LTtHVNm6nCLCEq/9TrBLfonj5BQ) that I used to generate the test cases.
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so shortest submission in bytes, wins! If you liked this challenge, consider upvoting it... And happy golfing!
---
This is the second challenge of the [RGS Golfing Showdown](https://codegolf.meta.stackexchange.com/q/18545/75323). If you want to participate in the competition, you have 96 hours to submit your eligible answers. Remember there is still 400 reputation in prizes! (See 6 of [the rules](https://codegolf.meta.stackexchange.com/q/18545/75323))
Also, as per section 4 of the rules in the [linked meta post](https://codegolf.meta.stackexchange.com/q/18545/75323), the "restricted languages" for this second challenge are: [05AB1E](https://codegolf.stackexchange.com/a/200009/75323), [W](https://codegolf.stackexchange.com/a/200004/75323), [Jelly](https://codegolf.stackexchange.com/a/200043/75323), [Japt](https://codegolf.stackexchange.com/a/200132/75323), [Gaia](https://codegolf.stackexchange.com/a/200042/75323), [MathGolf](https://codegolf.stackexchange.com/a/200033/75323) and [Stax](https://codegolf.stackexchange.com/a/200037/75323), so submissions in these languages are not eligible for the final prize. But *they can still be posted!!*
Otherwise, this is still a regular [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") challenge, so enjoy!
  
[Answer]
# [CP-1610](https://en.wikipedia.org/wiki/General_Instrument_CP1600) machine code ([Intellivision](https://en.wikipedia.org/wiki/Intellivision)), ~~23~~ 22 DECLEs1 ≈ 28 bytes
*As per the exception described [in this meta answer](https://codegolf.meta.stackexchange.com/a/10810/58563), the exact score is **27.5 bytes** (220 bits)*
A routine taking a null-terminated string as an inline argument through **R4** and returning the result in **R1**.
```
**2B9 001** |         MVII    #1,     R1
**2A0** | @@read  MVI@    R4,     R0
**080** |         TSTR    R0
**204 00F** |         BEQ     @@rtn
**378 05B** |         CMPI    #'[',   R0
**22C 007** |         BNEQ    @@read
**2A0** |         MVI@    R4,     R0
**00C** |         INCR    R4
**320** |         SUB@    R4,     R0
**020** |         NEGR    R0
**008** |         INCR    R0
**004 11C 1DC** |         CALL    MULT
**091** |         MOVR    R2,     R1
**220 012** |         B       @@read
**0A7** | @@rtn   JR      R4
```
### A note about subroutine calls
The CP-1610 instruction for calling subroutines is `JSR Rx, $address`. This instruction saves the return address in `Rx` instead of pushing it on the stack as many other CPUs do.
This allows to pass a block of arguments that immediately follows the function call. This is a common practice in CP-1610 programming and that's what we use here.
```
        JSR     R4,     count     ; call to subroutine through R4
        STRING  "[*-0]", 0        ; argument
        ...                       ; we will return here
```
Obviously, the subroutine is responsible for reading the correct number of arguments and eventually jumping to the expected return address.
### Full commented test code
```
        ROMW    10                ; use 10-bit ROM width
        ORG     $4800             ; map this program at $4800
PNUM    QEQU    $18C5             ; EXEC routine: print a number
MULT    QEQU    $1DDC             ; EXEC routine: signed multiplication
        ;; ------------------------------------------------------------- ;;
        ;;  main code                                                    ;;
        ;; ------------------------------------------------------------- ;;
main    PROC
        SDBD                      ; set up an interrupt service routine
        MVII    #isr,   R0        ; to do some minimal STIC initialization
        MVO     R0,     $100
        SWAP    R0
        MVO     R0,     $101
        EIS                       ; enable interrupts
        MVII    #$200,  R3        ; R3 = backtab pointer
        JSR     R4,     count     ; test cases
        STRING  "", 0
        CALL    print
        JSR     R4,     count
        STRING  "a", 0
        CALL    print
        JSR     R4,     count
        STRING  "[*-0]", 0
        CALL    print
        JSR     R4,     count
        STRING  "[0-9][0-9]", 0
        CALL    print
        JSR     R4,     count
        STRING  "[a-z]d[A-z]", 0
        CALL    print
        JSR     R4,     count
        STRING  "[<->]", 0
        CALL    print
        JSR     R4,     count
        STRING  "[!-&]", 0
        CALL    print
        JSR     R4,     count
        STRING  "[d-z]abf[d-z]fg", 0
        CALL    print
        JSR     R4,     count
        STRING  "[[-]]", 0
        CALL    print
        JSR     R4,     count
        STRING  "[a-a][b-b]cde[---]", 0
        CALL    print
        JSR     R4,     count
        STRING  "[0-1][0-1][0-1][0-1][0-1][0-1][0-1][0-1][0-1][0-1][0-1][0-1]", 0
        CALL    print
        JSR     R4,     count
        STRING  "[--[][--]]", 0
        CALL    print
        JSR     R4,     count
        STRING  "[[-[].[]-]]", 0
        CALL    print
        DECR    R7                ; done: loop forever
        ENDP
        ;; ------------------------------------------------------------- ;;
        ;;  prints the result of a test case                             ;;
        ;; ------------------------------------------------------------- ;;
print   PROC
        PSHR    R5                ; save the return address on the stack
        MOVR    R1,     R0        ; R0 = number to print
        MVII    #4,     R1        ; R1 = number of digits
        MOVR    R3,     R4        ; R4 = backtab pointer
        ADDI    #5,     R3        ; advance by 5 characters for the next one
        PSHR    R3                ; save R3
        CLRR    R3                ; R3 = attributes (black)
        CALL    PNUM              ; invoke the EXEC routine
        PULR    R3                ; restore R3
        PULR    R7                ; return
        ENDP
        ;; ------------------------------------------------------------- ;;
        ;;  ISR                                                          ;;
        ;; ------------------------------------------------------------- ;;
isr     PROC
        MVO     R0,     $0020     ; enable display
        CLRR    R0
        MVO     R0,     $0030     ; no horizontal delay
        MVO     R0,     $0031     ; no vertical delay
        MVO     R0,     $0032     ; no border extension
        MVII    #$D,    R0
        MVO     R0,     $0028     ; light-blue background
        MVO     R0,     $002C     ; light-blue border
        JR      R5                ; return from ISR
        ENDP
        ;; ------------------------------------------------------------- ;;
        ;;  our routine                                                  ;;
        ;; ------------------------------------------------------------- ;;
count   PROC
        MVII    #1,     R1        ; initialize R1 to 1
@@read  MVI@    R4,     R0        ; R0 = current character
        TSTR    R0                ; end of string?
        BEQ     @@rtn             ; if yes, return
        CMPI    #'[',   R0        ; is this a '['?
        BNEQ    @@read            ; if not, just go on with the next character
        MVI@    R4,     R0        ; R0 = ASCII code of the starting character
        INCR    R4                ; skip the '-'
        SUB@    R4,     R0        ; subtract the ASCII code of the ending character
        NEGR    R0                ; negate
        INCR    R0                ; increment
        CALL    MULT              ; compute R2 = R0 * R1
        MOVR    R2,     R1        ; and save the result in R1
        B       @@read            ; go on with the next character
@@rtn   JR      R4                ; return
        ENDP
```
### Output
[![output](https://i.stack.imgur.com/jIP2c.gif)](https://i.stack.imgur.com/jIP2c.gif)
*screenshot from [jzIntv](http://spatula-city.org/~im14u2c/intv/)*
---
*1. A CP-1610 opcode is encoded with a 10-bit value (0x000 to 0x3FF), known as a 'DECLE'.*
[Answer]
# [Haskell](https://www.haskell.org/), ~~50~~ 48 bytes
```
f[]=1
f('[':a:b:c:s)=length[a..c]*f s
f(a:s)=f s
```
[Try it online!](https://tio.run/##nY1BDoJADEX3nqJOjCixBJZOxMRzNF10gAEiTIiw8vLjMIQLuHl9/zdNO5nfzTB4b4nL4mAvCSVatNGVnq/l0Lh26UiyrOLUwhz2svZB/Si9gxKmT@8WOMEoE1ggpW6gZAWlmHOUHO8cEZPgl2t6Bcb4wOcmRzxvUoeVGBunbWNFyPuxMBk0XNUNIeL@oOA/odj/AA "Haskell – Try It Online")
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), ~~66 65~~ 60 bytes
```
s=>(s.replace(/\[.../g,s=>r*=([,b]=Buffer(s))[3]-b+1,r=1),r)
```
[Try it online!](https://tio.run/##rdLBTsQgEAbgu0@x7sHA2qF0u6s2kU30NcY5QAuNptluqHrw5SvtUXrZIoefhMMH/JkP/a2H2r9fPuHcN3Z0ahzUiQ3C20una8vyNxRC5G0Wjv1OMcwMqdcv56xnA@dYEpj7IvOq4JnnY92fh76zoutb5th2y/kmaeX5prj5g@pUdQnFHUhKgQP6GKESKppjpTy9VMqI1fBDDb6EXOdO7FE@Re4znFI7KCP0Fu5S0YcIbcLftXHz7trr@YAe91XEItD/F6BBExowVDcWAeDaGxbHVUJBK2O@PqAHWcXFAiCFoISJ3ZeyXGgWSSCthqcSxl8 "JavaScript (Node.js) – Try It Online")
### Commented
```
s => (                      // s = input string
  s.replace(                // find in s all occurrences of
    /\[.../g,               // '[' followed by 3 characters
    s =>                    // given the matched string s:
      r *=                  //   multiply r by:
        ([, b] = Buffer(s)) //     the difference between
        [3]                 //     the ASCII code of the 4th character
        - b                 //     and the ASCII code of the 2nd one
        + 1,                //     + 1
      r = 1                 //   start with r = 1
  ),                        // end of replace()
  r                         // return r
)                           //
```
---
# [JavaScript (Node.js)](https://nodejs.org), ~~65~~ 64 bytes
A recursive solution.
```
f=s=>s?-~([g,b,,c]=Buffer(s),!(g^=91)*(c-b))*f(s.slice(g?1:5)):1
```
[Try it online!](https://tio.run/##rdJBT8MgFAfwu59i28FA09fBatUudot@DfJMgAKZaVYz1IMHv3qlPUovK3L4c/s9@Oe9yS/p9eX0/gHnvjXDYBvfHPwRfohwucpzjc3Lp7XmQjzN18S9NjWnGdGgKM0s8YXvTtoQd@T7itI9H3R/9n1niq53xJLNhtJV0tluV/zmDypT1TlUZMAwBQ7oQ4QyqHGKhfL4UsYiVsI3tuI55DJ3ZCv2GLlPcEjtoIzQNdymovcR2oa/S2Wn27rr@YBWuzpiBeD/FyBBolCgULdGAMC1E2bXlQHHhTGND@gdq@NiAQSGwISN3ZWsnGlWYCFwMTyWMPwC "JavaScript (Node.js) – Try It Online")
### Commented
```
f = s =>             // f is recursive function taking a string s
  s ?                // if s is not empty:
    -~(              //   add 1 to the result of the multiplication below
      [g, b,, c] =   //     g, b, c = ASCII codes of 1st, 2nd and 4th characters
        Buffer(s),   //
      !(g ^= 91) *   //     true if g is a '[', or false otherwise
      (c - b)        //     multiply it by the width of the ASCII range
    ) *              //   multiply by ...
    f(               //   ... the result of a recursive call
      s.slice(g ? 1  //     discard 1 character if it was not a group
                : 5) //     or 5 if it was
    )                //   end of recursive call
  :                  // else:
    1                //   stop recursion
```
[Answer]
# [MATL](https://github.com/lmendo/MATL), ~~22~~ 21 bytes
*1 byte saved thanks to [@DeathIncarnate](https://codegolf.stackexchange.com/users/91386/deathincarnate)*
```
'\[.-.'XX"@gHKh)dQ]vp
```
[Try it online!](https://tio.run/##y00syfn/Xz0mWk9XTz0iQskh3cM7QzMlMLasACgcrasbHQskYmPVAQ) Or [verify all test cases](https://tio.run/##y00syfmf8F89JlpPV089IkLJId3DO0MzJTC2rOC/S8h/dXUu9UQgjtbSNYgF0Qa6lrFgAsRJ1K2KTYl2BJIgno2uHZhW1FUD0ylA8cSkNDCdlg4SidaNhepLjI1O0k2KTU5JjdbV1YWabBhLJgHSrqsbHQskIBZEAzl60bEgHgA).
### How it works
```
'\[.-.'    % Push this string, to be used as regexp
XX         % Implicit input. Cell array of substrings that match the regexp
"          % For each
  @g       %   Push current substring
  HKh      %   Push 2, then 4, concatente horizontally: gives [2 4]
  )        %   Index: gives a string of two chars
  d        %   Consecutive difference (of code points)
  Q        %   Add 1
]          % End
v          % Concatenate all stack contents vertically (result may be empty)
p          % Product. Implicit display
```
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~58~~ ~~56~~ ~~54~~ ~~52~~ 50 bytes
```
f(char*s){s=*s?*s++-91?f(s):(s[2]-*s+1)*f(s+4):1;}
```
[Try it online!](https://tio.run/##tdJBT8IwFAfws36KMaNpOx@0G6gDhPg56jt0LYUlOA3Fi4TPPssit3JgjT28Nj38@vrP07DWur2rG739Nqtk7vam/hxuFq0leqN2zNGDe2VuyVyWQSmWljg6JU7mCP5KUOYvsjGditmx/VB1Q@jh9mtXN3tL0nvz3qSPiT@llM6SmDUaJSLgqlj4gisZcIyxvfsccjmU2JWe@KlfzkOygh808s3XfvRJnvCXED2HRWwYRcgdwEOs@xRyjQ9BVbbb7fr6F7w7ycuQLAH/JQkFCmUFFWqzkgBw7SOXxpiDwJ6l68C7Y14GQwaQ6AtGTHJe8CKcssShxD/7plvnTx7bXw "C (gcc) – Try It Online")
Thanks to @S.S. Anne for 2 bytes, and to @Arnauld for 2 more bytes!
This is a recursive solution in C.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~31~~ ~~21~~ ~~20~~ 19 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
ü5ε2ι`Çs…[-]Q*ÆÄ>}P
```
-10 bytes thanks to an alternative approach suggested by @ExpiredData.  
-2 bytes and a bugfix for `[[-[].[]-]]` thanks to *@Grimmy*.
[Try it online](https://tio.run/##yy9OTMpM/f//8B7Tc1uNzu1MONxe/KhhWbRubKDW4bbDLXa1Af//R6foVsUmJqWB6bR0AA) or [verify all test cases](https://tio.run/##yy9OTMpM/V9Waa@k8KhtkoKSfeX/w3tMz201Orcz4XB78aOGZdG6sYFah9sOt9jVBvzX@R@tpKSjlAjE0Vq6BrEg2kDXMhZMgDiJulWxKdGOQBLEs9G1A9OKumpgOgUonpiUBqbT0kEiQNOh@hJjo5N0k2KTU1KjdXV1oSYbxpJJgLTr6kbHAgmIBdFAjl50LIgXCwA).
**Explanation:**
```
ü5          # Push all substrings of length 5 of the (implicit) input-string
  ε         # Map each substring abcde to:
   2ι       #  Uninterleave it into 2 blocks: [ace, bd]
     `      #  Push both strings separated to the stack
      Ç     #  Convert the top (bd) to a list of ASCII codepoint integers [B,D]
   s        #  Swap to get the other string (ace) at the top again
    …[-]Q   #  Check if it's equal to "[-]" (1 if truthy; 0 if falsey)
         *  #  Multiply the codepoints by that ([B,D] if truthy; [0,0] if falsey)
   ÆÄ       #  Take the absolute difference between those two (D-B if truthy; 0 if falsey)
     >      #  And increase this by 1
  }P        # After the map: take the product (which will of course be 1 for empty lists)
            # (after which this is output implicitly as result)
```
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~77~~ \$\cdots\$ ~~59~~ 58 bytes
Saved 2 bytes thanks to [Kevin Cruijssen](https://codegolf.stackexchange.com/users/52210/kevin-cruijssen)!!!  
Saved ~~11~~ 13 bytes thanks to [Arnauld](https://codegolf.stackexchange.com/users/58563/arnauld)!!! 
```
r;f(char*s){for(r=1;*s;)r*=*s++-91?1:1-*s+(s+=3)[-1];s=r;}
```
[Try it online!](https://tio.run/##tdOxTsMwEAbgvU8RIoFsh1PthhaCCYjncG9wHNx2ICCbiarPHq6Z3aGx8HC@6Tvr19nBzrlxDNozt7dBRH70X4GFVmkRNQ@iFbGqoFFv6lkB9SxWbc0NKNSxDfo0ftrDwPhx8R0Ow49n5W2/Hcr7grqSc13knOWyUAnX5sIXXCNAYo5N7mPKldDgVGbi5/dKmZIt/GJv3qnOo8/yWj6l6Bd4zQ2jTrk3cJfrblJuTyHYzk@3310/gdz1qknJBvBfkrBg0XTQoes/DABcO@TSGkv6nDPL9AJyH2STDBnAIBXM2ORVLevFafwD "C (gcc) – Try It Online")
[Answer]
# [Python 3](https://docs.python.org/3/), ~~77 75~~ 73 bytes
```
f=lambda s:s==''or'['!=s[0]and f(s[1:])or(ord(s[3])-ord(s[1])+1)*f(s[5:])
```
[Try it online!](https://tio.run/##nY/PToQwEMbvPEW3B2lXZ1MWUSGyie/grZlDEXBJEEjLxijh2XG2rO7dy3R@3zf/OnyNx76Ll6XOW/NRlIa5zOV5GPY21OEmd1qh6UpWC6ejDGVvRW9LghglrFmE8jaS23NFQhXLYJtuFLXgXMrg89i0FXu1pyoLmLuzedMNp1HInRvaZhScwYFxSRbL2XkDRBgwS2B3brTNIMi7DAz55GbfMNEuOTM92RlDuXAvRgE3v4negkIPjwQKUvRhtZUizcA3lvqF4iom6onUZzisHBNs4GaFB4KSKk1R@7d@93KyT8nQgNcWAwZ1AQW@lZUGAPw7SNHH/hn8jHuVns8A0EjhsnIfq/gH "Python 3 – Try It Online")
*-2 bytes thanks to @Arnauld*  
*-2 bytes thanks to @KevinCruijssen*
[Answer]
# [Raku](https://github.com/nxadm/rakudo-pkg), 37 bytes
```
{[*] map {137+[R-] .ords},m:g/\[.../}
```
[Try it online!](https://tio.run/##nY6xDoJADIZ3n6IyMICFQwXEKImvoOPR4RCOmIAQmJDw7OfliLq7/O33/23TruzrSDUj2BLOauIOQSM6mIJd7PIrEnhtXwzzpjlWfsY9z/NnNYgRJDR@dnN9kG0P9eNZDsqyAFMIVpb4NNxBRgZiDQwTMrLEjGlP4IsKftG6mCE7aPeE6cI7DWu0F4g0FHpS5NJUWRk73CY64Ei/FYGCeI453YuSIyJ9H2IY0J9ibuxZEr0B "Perl 6 – Try It Online")
[Answer]
# [R](https://www.r-project.org/), 73 bytes
```
function(s,i=el(gregexpr("\\[.-",s)),u=utf8ToInt(s))prod(u[i+3]-u[i+1]+1)
```
[Try it online!](https://tio.run/##nY5Pj4IwEMXvfgrFZFNWnmll/UMiJh69722cQxFKSAwYhMTsl2drF1y9ennT@b3OzKs7E3emLU9NUZXiGhRxdhZ5neXZ7VIL73ikObzg6vtBG7eN2XxXh7IRtr/UVSpaKmYh414Uz5TfGeF5/niK3ViN7Fs/N/QJyT1YOyARsZPhm5SOa/xwSnurg7GUG@dssRtY6MAEHwNYOZDaKZ0YV03eW8tF5EwCv45raKYECZ/SjADwS2AJxW9Kv@dLRn@xAGIrj/OLUIZ9JOI58b@jul8 "R – Try It Online")
Today I learned that to include the character `[` in a regexp, you need to escape it twice: `\\[`.
[Answer]
# [GolfScript](http://www.golfscript.com/golfscript/), 40 38 36 29 27 bytes
```
1{\(91={(\(;(@-)}1if@*1$}do
```
[Try it online!](https://tio.run/##S8/PSStOLsosKPmvFJ2oWxWbEu0IJJX@G1bHaFga2lZrxGhYazjoatYaZqY5aBmq1Kbk//8PAA "GolfScript – Try It Online")
With a bit of teamwork, Grimmy and I have this baby down fairly low. it's a shame my goofy integer trick is no longer here :( Check edits for a neat little GS trick.
```
1{\(91={(\(;(@-)}1if@*1$}do # Regex Counter
1                           # Our stack is now [str 1]
 {                      }do # Pop the top value after a run. If it's true, loop.
 {\                     }do # Swap the top two element of the stack. [1 str]
 { (91={        }1if    }do # Pop the first char and see if it's "[".
 {     {        }       }do # If so, do the following.
 {     {(\(;(@  }       }do # Get rid of the garbage in our block, leaving just the params
 {     {      - }       }do # Find the difference
 {     {      -)}       }do # Increment
 {               1      }do # If the if statement fails, instead push a 1.
                             # At this point, our stack is [1 str dif] (dif may be 1)
 {                  @   }do # Bring our 1 up. [str dif 1]
 {                   *  }do # Multiply our 1 by dif. [str dif*1]
 {                    1$}do # Duplicate our string. [str dif*1 str]
                             # At this point, if our string is empty, our stack is
                             # ["" dif*1 ""], and we see the output. If it ISN'T
                             # empty, then dif*1 is our new 1, and the next loop
                             # works with this loop's dif instead of with a 1.
                             # This functionally multiplies all the values together.
```
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 21 bytes
```
*Fmhs.+CMtd:Q"\[.-."1
```
[Try it online!](https://tio.run/##nY27CsJAEEV7/8ItUkTvkpSKCiKk0mLrcYpdJw@EgGCa@PPrzpovsJhzORdm5jVPQ7y226MLsWzG4W03l9ske2fuZGFNHZ/jLNZFY1bGp6ESFWtW2HGGiseHhc6Jageccq5R5JTU@9Dl7HptCLzseaaAwA9pCcByueY/oesAccLvASWxxGpf "Pyth – Try It Online")
Standard regex match with `:Q"\[.-."1`. Then, we remove the leading `[` with `td` and convert to characters with `CM`.
Next, the clever part: `.+` gives deltas between the code points, and `s` adds up the deltas. This gives just the difference between the first and last characters, ignoring the `-`.
Finally, `h` adds one, and `*F` multiplies everything together.
[Answer]
# [C++ (gcc)](https://gcc.gnu.org/), 70 bytes
```
int f(char*s){int r=1;for(;*s;)r*=*s++-91?1:1-*s+(s+=3)[-1];return r;}
```
[Try it online!](https://tio.run/##tdPBUoMwEAbge58CcXQIuDYpVsWUOj5H3ENIoGWmUibQi50@OwbO6aFkzGGTXL7d@SdRbQs7pYahbvqgitRemrgj5/Fmcsaro4l43HFi4jzukgQy9sk@GNhz1CV5SgQw5KbsT6YJDL8M93WjDiddBhvV9bo@bhcj9SPrJiLnRWvsrYrCB/3dhE@2XxgSwgOftVwGzOFKX/iKK2Kg6GNb983lUshwKjPxcV5KXbKEX9Tiy9Z59Civ6buL3sDWN4zU5d7Bo6/76nK1DUEW1bRXu9s7WHe9ylyyAPyXJCRIFAUUqHQpAODWJteeMbX/dmaZJrDuC82cIQMItAU9XvIqpak7ZYHPAmfbUxqX4Q8 "C++ (gcc) – Try It Online")
[Answer]
# [BBC BASIC V](http://www.riscos.com/support/developers/manual_index/basic.html), 92 bytes
```
DEFFNf(X$):O=1:FORI=1TOLEN(X$):IFMID$(X$,I,1)="["THENO=O*(1+ASC(MID$(X$,I+3,1))-ASC(MID$(X$,I+1,1))):I=I+5
NEXT:=O
```
Defines a function that takes a single string argument and returns an integer. Note BBC BASIC V (as implemented on the Acorn Archimedes and RISC PC) was a tokenised language, so commands like `MID$` are a single byte. Unfortunately I can't find an online implementation of this, but [RPCEmu](http://www.marutan.net/rpcemu/index.php) can be used to test this.
[Answer]
# [Husk](https://github.com/barbuz/Husk), 22 [bytes](https://github.com/barbuz/Husk/wiki/Codepage)
```
ΠmöLu…Ċ2mtf·=Ċ"[-]"2X5
```
**[Try it online!](https://tio.run/##yygtzv7//9yC3MPbfEofNSw70mWUW5J2aLvtkS6laN1YJaMI0////0fr6kbHAonYWAA "Husk – Try It Online")**
### How?
```
ΠmöLu…Ċ2mtf·=Ċ"[-]"2X5 - string S
                    X5 - sublists of length five
          f            - filter by predicate:
           ·           -   compose two functions:
             Ċ     2   -     2-gaps (every 2nd element) (e.g. "[a-e]" -> "[-]")
            = "[-]"    -     equal to "[-]"?
        m              - map with:
         t             -   tail (e.g. "[a-e]" -> "a-e]")
 m                     - map with:
  ö                    -   compose four functions:
      Ċ2               -     2-gaps (every 2nd element) (e.g. "a-e]" -> "ae")
     …                 -     fill (e.g. "ae" -> "abcde" -- Note: "xx" -> "xx")
    u                  -     remove duplicates (e.g. "xx" -> "x")
   L                   -     length
Π                      - product
```
[Answer]
# brainfuck, ~~134~~ ~~125~~ 119 bytes
```
-[+[+<]>>+]<+++<+>>>,>+<[<<[->+>-<<]>>[[+]<<<[->+<]>>>>-]>[>,<,,>[-<->]<+<<<<[->>>>[-<+<<+>>>]<[->+<]<<<]>>>>>]+<,]<<<.
```
A commented version can be found below. Saved 9 bytes thanks to @S.S.Anne.
You can [try it online](https://copy.sh/brainfuck/?c=SW5pdCBhIGNlbGwgd2l0aCA5MQotWytbKzxdPj4rXTwrKysKPCs-Pj4sPis8Ck1lbTogYWNjdW11bGF0b3IgPSAxIHwgbGVmdCBicmFja2V0ID0gOTEgfCAwIHwgXmlucHV0IGNoYXIgfCAxIHwgMApbIElmIHNvbWV0aGluZyB3YXMgcmVhZApTdWJ0cmFjdCB0aGUgOTEgZnJvbSB0aGlzIGNoYXIKPDxbLT4rPi08PF0KPj4KTWVtOiBhY2N1bXVsYXRvciB8IDAgfCA5MSB8IF5pbnB1dCBtaW51cyA5MSB8IDEgfCAwClVzZSBub24gZGVzdHJ1Y3RpdmUgZmxvdyBjb250cm9sIHRvIGNoZWNrIGlmIHRoZSBpbnB1dCBjaGFyIHdhcyB0aGUgYmVnaW5uaW5nIG9mIGEgcmFuZ2UKWyBJZiB0aGUgYXNjaWkgY29kZSBwb2ludCB3YXMgbm90IDkxIHRoZW4gdGhpcyBpcyBhIHNhZmUgY2hhcmFjdGVyClplcm8gb3V0IHRoZSBpbnB1dCBjaGFyClsrXQpNb3ZlIHRoZSBhY2MgdG8gdGhlIHJpZ2h0Cjw8PFstPis8XT4-PgpSZW1vdmUgdGhlIGVsc2UgZmxhZwo-LV0gKGVuZCBpZikKPgpbIEVsc2UgdGhlIGNoYXJhY3RlciBzdGFydHMgYSByYW5nZSBhbmQgbGF5b3V0IGlzCk1lbTogYWNjIHwgMCB8IDkxIHwgMCB8IF4xIHwgMAo-LDwsLApNZW06IGFjYyB8IDAgfCA5MSB8IDAgfCBecmlnaHQgY2hhciB8IGxlZnQgY2hhcgpTdWJ0cmFjdCB0aGUgdHdvIGFuZCBhZGQgb25lCj5bLTwtPl08KwpNZW06IGFjYyB8IDAgfCA5MSB8IDAgfCBeZGlmZiBwbHVzIG9uZSB8IDAKICAgICAgICAgICAgICAgICAgICBBICAgQiAgICAgICAgICAgICAgICBDCk11bHRpcGx5IHRoZSBhY2N1bXVsYXRvciBieSB0aGUgZGlmZiBwbHVzIG9uZQpUaGUgZGlmZiBwbHVzIG9uZSB3aWxsIGJlIGp1Z2dsZWQgYXJvdW5kIEEgYW5kIEIKPDw8PFsgV2hpbGUgdGhlIGFjYyBpcyBzdGlsbCBub256ZXJvCi0-Pj4-ClstPCs8PCs-Pj5dCjxbLT4rPF0KPDw8Cl0gKGVuZCB3aGlsZSkKTWVtOiBeMCB8IGFjYyB8IDkxIHwgMCB8IGRpZmYgcGx1cyBvbmUgfCAwCj4-Pj4-Cl0gKGVuZCBlbHNlKQpNZW06IDAgfCBhY2MgfCA5MSB8IDAgfCA_IHwgXjAgfCAwClJlc2V0IHdvcmtwbGFjZQorPAosIFRyeSByZWFkaW5nIGFnYWluCk1lbTogYWNjIHwgOTEgfCAwIHwgXmlucHV0IGNoYXIgfCAxIHwgMApdCjw8PC4$), where you can check the "memory dump" to see that the final output is the correct result. In practice only works for tests where final result is `<= 255`.
You are welcome to golf my code, just keep it commented please. Then use [this Python script on TIO](https://tio.run/##fVRNb9swDL3rVxA5xbAdtNiphaqhHXbooZeuw4AZLqDIsq1WlgxJXpBh/z2j5CRLvxbEgE2Lj4/vkR63obfm007YRsIVLBaL3a1RATgIqTVsVOjh4pyUVV7ltGYsr2me54TmjLGC5ZTcyeESuBDTMGkerEOQc/gDWrYB1o6LZxkwdBFjZ3g9KjNOAUTPHT6lKKngtgVvBxl6ZTrYcA9O8oZ8m9YBEQKEXkaE1tkB75VP6YTSqmQ5KymtCWNvicwFU@V91UGZyc@RufJ3L8FYA430wU0iqF8SWm03IKwJzmoIFmtJ8QyqTSxO2EeaMbSWnTImErctyua46eTcUnzLvVAKkrqjVSakNGNDZIHvzdwP/jl43soEjS1LR35KZ8FO4VVdUuU1ubNINMELETnGW6e6PqAoSZVoFSP3cjgclNrH1nhHWFnDUpoGW8oIQ6Zf46t45lgbfOAu@EM3wPG05ttIRvmj0KcCJ2tnTVlBi@LjQ4nmwf80JamrF16HjU01edOANZKwqqQlw8n7GLZRbQujRnsxIfGAd37XeN28Dn4hd5MOatTbg6THEVrPoRfg5OF1BLcEV2Ut4WnqOi2Rt7MT0r9OTdxET2gFP3ql/5mGjvsQ03D8fqPTpGTRMWw0p2m5arI3MqaTvWWbiJHNKjzGvmcpjjK8VYEl2H16HIJ99jvJn6OOZynrXnpc2411z6PmQhLc8wIe3DbtZRx13nFlTt3474KnHlY7/LgQYkcfvzPFqqopy0uMjA73YumnYYmexU1ZCZQvLCNEBi3akMCUAcwlWXbIWCxWT7hSy1ZpnNml5sO6wc/WpdgfLRJYlmW7vw) to do the byte count and remove comments.
```
Init a cell with 91
-[+[+<]>>+]<+++
<+>>>,>+<
Mem: accumulator = 1 | left bracket = 91 | 0 | ^input char | 1 | 0
[ If something was read
Subtract the 91 from this char
<<[->+>-<<]
>>
Mem: accumulator | 0 | 91 | ^input minus 91 | 1 | 0
Use non destructive flow control to check if the input char was the beginning of a range
[ If the ascii code point was not 91 then this is a safe character
Zero out the input char
[+]
Move the acc to the right
<<<[->+<]>>>
Remove the else flag
>-] (end if)
>
[ Else the character starts a range and layout is
Mem: acc | 0 | 91 | 0 | ^1 | 0
>,<,,
Mem: acc | 0 | 91 | 0 | ^right char | left char
Subtract the two and add one
>[-<->]<+
Mem: acc | 0 | 91 | 0 | ^diff plus one | 0
                    A   B                C
Multiply the accumulator by the diff plus one
The diff plus one will be juggled around A and B
<<<<[ While the acc is still nonzero
->>>>
[-<+<<+>>>]
<[->+<]
<<<
] (end while)
Mem: ^0 | acc | 91 | 0 | diff plus one | 0
>>>>>
] (end else)
Mem: 0 | acc | 91 | 0 | ? | ^0 | 0
Reset workplace
+<
, Try reading again
Mem: acc | 91 | 0 | ^input char | 1 | 0
]
<<<.
```
[Answer]
# [SNOBOL4 (CSNOBOL4)](http://www.snobol4.org/csnobol4/), ~~138~~ 133 bytes
```
	I =INPUT
	P =1
	A =&ALPHABET
	L =LEN(1)
N	I '[' L . X L L . Y REM . I	:F(O)
	A X @S
	A Y @E
	P =P * (E - S + 1)	:(N)
O	OUTPUT =P
END
```
[Try it online!](https://tio.run/##HY3BCsIwEETPyVfMySaVCgVPhUArrhiISbAttIRcPIs9@P/ErZd5y@zO7Pezvbb3uRRhYayP8yRFhGmlGGAOg4v34ULsORhHXrVaer6sUgWHExbWnSue9GBa0d1U0Ht4QT/uXNHTvzKihiI0GHFEq0WnvJZBhHnip7yW5K@lpKZJmSXnlHj6AQ "SNOBOL4 (CSNOBOL4) – Try It Online")
[Answer]
# [Shakespeare Programming Language](https://github.com/TryItOnline/spl), ~~493~~ 398 bytes
-2 bytes thanks to Jonathan Allan
-87 bytes (!) thanks to Jo King
```
,.Ajax,.Ford,.Act I:.Scene I:.[Enter Ajax and Ford]Ajax:You cat.Scene V:.Ajax:Is I as big as the sum ofThe cube ofa big big cat the cube ofThe sum ofA big cat a cat?If notLet usScene X.Remember you.Open mind.Ford:Open mind.Open mind.You is the sum ofA cat the difference betweenYou I.Ajax:Recall.You is the product ofyou I.Scene X:.Ford:Open mind.Ajax:Is I worse zero?If notLet usScene V.Open heart
```
[Try it online!](https://tio.run/##bZBLasMwEIavMgdIdABtghcNCAKBNIQU44Ueo8TFloweJOnlXUk2dihdaPQP843mH/mhG8cNqb75c0P21qmkZQBGyadEg1nUHyagg4wANwoy1eSMftkIkocZvdDyDGUeGHAPor3lK9wRfOzB6nNSMgpMkpdqPqm/IHPhvNDVUuY57pgGY8MBA0Q/DbySE/bYi2TuZSM5Dmigb40qe9A1XVU23L5bqpb5qtUaHRqJIDA8EE2G2bTSCSXvuvf2wVkV00dZ/SrY7Ij@nb3@yMM6j/CDzv6zymUyeUfuwjjWfCuaEmSttrr5BQ "Shakespeare Programming Language – Try It Online")
Ford is initialized as `1`. Ajax reads through the input. When he encounters a `[`, Ford reads the next and Ajax the third next character, and Ford is multiplied by the difference + 1. When Ajax reaches the end of the input, Ford opens his heart, printing his value.
The shortest representation I found of 91 (the ASCII code of `[`) is \$91=(2\times2)^3+(2+1)^3\$ but there might be something better.
With spaces and comments:
```
,.Ajax,.Ford,.                                         A = F = 0
Act I:.Scene I:.
[Enter Ajax and Ford]
Ajax: You is a cat.                                    F = 1
Scene V:.
Ajax: Is I as big as the sum of                        if not(A == 91) (with 91=64+27)
The cube of a big big cat                              (2*2)^3 (=64)
the cube of The sum of A big cat a cat?                (2+1)^3 (=27)
If not Let us Scene X.                                 go to Scene X
Remember you.                                          F[2] = F
Open mind.                                             F = stdin
Ford: Open mind. Open mind.                            A = stdin
You is the sum of A cat the difference between You I.  A = 1 + A -F
Ajax: Recall.                                          F = F[2]
You is the product of you I.                           F = F * A
Scene X:.
Ford: Open mind.                                       A = stdin
Ajax: Is I worse zero? If not Let us Scene V.          if not(A<0) go to Scene V
Open heart                                             print(F)
```
[Answer]
# [C# (Visual C# Interactive Compiler)](http://www.mono-project.com/docs/about-mono/releases/5.0.0/#csc), ~~80~~ 76 bytes
```
r=>{int c=1,i=r.Length;for(;i-->1;)c*=r[i]==93?r[--i]-r[i-=2]+1:1;return c;}
```
[Try it online!](https://tio.run/##nZA9b8IwEIZ3fkVgQAnNIQwTGAchJCZ2BuuGxLHTkypHujhLq/72YNG5RmJ5707vo/syA5iBpuvozXEITL4rM/KhypyaWFU/Mc@MEiUpXt@s78KndD3nkgAqIQuzUqwJldrvTqwBCCHWoLb4IQ5Csg0j@8zI30nOZpfeD/2XXd@Zgr2Rt7nL88WiKAr5j1enTL2CDSaBDezxKUmqhm9s9TlqEjtClQbmsEwDbRxRN@4ZXfdipxp1Aw2a1sa3wqs7Bb4pyb4AGqPgHzU9AA "C# (Visual C# Interactive Compiler) – Try It Online")
Port of @KevinCruijssen's [Java answer](https://codegolf.stackexchange.com/a/200260/85908)
[Answer]
# Java 8, ~~80~~ 76 bytes
```
r->{int c=1,i=r.length;for(;i-->1;)c*=r[i]==93?r[--i]-r[i-=2]+1:1;return c;}
```
-4 bytes thanks to *@ExpiredData*.
[Try it online.](https://tio.run/##nVKxbsIwEN35CjdDcUgvIu0EbqhQ57Iwph4cxwHT4KCLoaKIb0@NQ6U2bF3e6d6dz0/vbiMOAjbFRysr0TTkTWhzGhCijVVYCqnI4pJ6gkgq1wIzTjBkjjwPHCyIIWmLMDv5jjR50CnGlTIru2ZljZRpgFnCQjlKMdM8TSdPL5gBaA4uh/SRR8k0YajsHg2R7Nyyy9zdPq@0JI0V1oVDrQuyddro0qI2K6dBhJ0wqxpLg8Ar@snE3zQbwZj3qDFMuIceL@CLF9ncYa/wDLM@dQf3fapwD0Ve@liubmYLnuWQc1ko5wDcakr4P6E3CSDjDviV95v6baVv66x0y@yMXB4bq7ZxvbfxzhVsZegwGEYYBe/BlASRUZ/@PGgYm1hSjG396s5hjiiONAyvH53bbw)
**Explanation:**
```
r->{               // Method with character-array parameter and integer return-type
  int c=1,         //  Count-integer, starting at 1
      i=r.length;  //  Index integer, starting at the length of the input
  for(;i-->1;)     //  Loop as long as the index is larger than 1,
                   //  and decrease the index every iteration by 1 right after this check
    c*=            //   Multiply the count by:
       r[i]==93?   //    If the `i`'th character of the input is a ']':
        r[--i]     //     Take the `i-1`'th character, by decreasing `i` with 1 first
        -r[i-=2]   //     And decrease it by the `i-3`'th character,
                   //     due to the earlier `--i` and by first decreasing `i` with 2 first
        +1         //     And add 1 to that difference
                   //     (NOTE: We've only decreased `i` by 3 instead of 4 here, but this
                   //      doesn't matter, since it will always be the '[' character of the
                   //      previous block in the next iteration, and thus multiplying by 1
                   //      in the else block)
       :           //    Else (single character match):
        1;         //     Keep the count the same by multiplying with 1
  return c;}       //  And then return this count as result
```
[Answer]
# [Whitespace](https://web.archive.org/web/20150618184706/http://compsoc.dur.ac.uk/whitespace/tutorial.php), 149 bytes
```
[S S S T    N
_Push_1][N
S S N
_Create_Label_LOOP][S N
S _Duplicate][S N
S _Duplicate][T N
T   S _Read_STDIN_as_character][T   T   T   _Retrieve_input][S N
S _Dupe][S S S T    S T S N
_Push_10][T S S T   _Subtract][N
T   S S S N
_If_0_Jump_to_Label_DONE][S S S T   S T T   S T T   N
_Push_91][T S S T   _Subtract][N
T   S S N
_If_0_Jump_to_Label_BLOCK_FOUND][N
S N
N
_Jump_to_Label_LOOP][N
S S S N
_Create_Label_BLOCK_FOUND][S N
S _Duplicate][S N
S _Duplicate][T N
T   S _Read_STDIN_as_character][T   T   T   _Retrieve][S N
S _Duplicate][S N
S _Duplicate][S N
S _Duplicate][T N
T   S _Read_STDIN_as_character][T   N
T   S _Read_STDIN_as_character][T   T   T   _Retrieve][S N
T   _Swap_top_two][T    S S T   _Subtract][S S S T  N
_Push_1][T  S S S _Add][T   S S N
_Multiply][S N
S _Duplicate][T N
T   S _Read_STDIN_as_character][N
S N
N
_Jump_to_Label_LOOP][N
S S S S N
_Create_Label_DONE][S N
N
_Discard][T N
S T _Print_as_integer]
```
Letters `S` (space), `T` (tab), and `N` (new-line) added as highlighting only.  
`[..._some_action]` added as explanation only.
Since Whitespace inputs one character at a time, the input should contain a trailing newline (`\n`) so it knows when to stop reading characters and the input is done.
[Try it online](https://tio.run/##bYxBCoAwDATPm1fsB3yReKjaqreCguDnYxKpXqShyU6YnOt25L2mKauShAgpjA8CAvBgC3uWAzKQL61eaKa4/aN/uTG4xXYOj@ShHYkBxlT7ubuGNJboZZEb) (with raw spaces, tabs and new-lines only).
**Explanation in pseudo-code:**
```
Integer count = 1
Start LOOP:
  Integer c = read STDIN as character
  If(c == '\n'):
    Jump to Label DONE
  If(c == '['):
    Jump to Label BLOCK_FOUND
  Go to next iteration of LOOP
Label BLOCK_FOUND:
  Integer a = read STDIN as character
  Read STDIN as character (without saving it)
  Integer b = read STDIN as character
  Integer diff = b - a
  diff = diff + 1
  count = count * diff
  Read STDIN as character (without saving it)
  Go to next iteration of LOOP
Label DONE:
  Print count as integer to STDOUT
```
[Answer]
# [Befunge-98 (PyFunge)](https://pythonhosted.org/PyFunge/), 30 bytes
```
1v;>.@;  <
*>#^~'[-#^_~~$~\1--
```
[Try it online!](https://tio.run/##S0pNK81LT9W1tNAtqAQz//83LLO203OwVlCw4dKyU46rU4/WVY6Lr6tTqYsx1NX9/z86UbcqNiXaEUgCAA "Befunge-98 (PyFunge) – Try It Online")
### Explanation
```
1v
 >
```
Push `1` to the stack and move east in the second line
```
 >.@
#^~
```
Input character (`~`), if no input is left print the TOS (`.`) and quit the execution (`@`).
```
'[-#^_
```
Subtract `[` from the input, if the input is `[` continue east, otherwise go north.
```
1v;>.@;  <
 >
```
Case input ≠ `[`: Go back to the start of the second line.
```
*>        ~~$~\1--
```
Case input = '[': Take the next three characters of input, discard the `-`, and compute the difference between the two remaining chars, multiply this to the current result.
Animation of the code for input `a[0-9]`:
[![Animation of the code](https://i.stack.imgur.com/1emMt.gif)](https://i.stack.imgur.com/1emMt.gif)
[Answer]
# Haskell, ~~66~~ 64 bytes
Non-regex solution.
```
f[]=1
f('[':a:b:c:d:s)=(1+(g c)-(g a))*f s
f(a:s)=f s
g=fromEnum
```
You can [try it online](https://tio.run/##y0gszk7Nyfn/Py061taQK01DPVrdKtEqySrZKsWqWNNWw1BbI10hWVMXSCZqamqlKRQDFSWCpEDMdNu0ovxc17zS3P@5iZl5CrYKBUWZeSUKKgppCkrRKbpVsYlJaWA6LV3pPwA)! Uses the algorithm in my Python reference implementation.
[Answer]
# [Python 3.8 (pre-release)](https://docs.python.org/3.8/), 87 bytes
-5 byte thanks to [@SurculoseSputum](https://codegolf.stackexchange.com/users/92237/surculose-sputum)
```
lambda s:math.prod(ord(m[3])-ord(m[1])+1for m in re.findall(r'\[.-.',s))
import re,math
```
[Try it online!](https://tio.run/##nYxNTgMxDIX3PkXYtAmto466gQqQOIfrRYZM2kiTHyXZlMsPmYET4MVn@9nv5Ue7p3h@yWVx4l1cl9mE0RpRL8G0u84lWZmKlYHOrPB3GlgdBpeKCMJHUSbtfLRmnmXZX0mj3h@rUuBDTqX183FNWv7W@qgAq3f2cVrtXdC1WR8vIHrl4mOTTq5npRYwQM94YqATvvIGIIPfbOmzE@gNPzqfcNdpu2JGt3V3AyLk7dswjTjyl50IEbesgf8J6BHEHcw/ "Python 3.8 (pre-release) – Try It Online")
[Answer]
# x86-16 machine code, 25 bytes
```
B3 01       MOV  BL, 1          ; init multiplier
        C_LOOP: 
AC          LODSB               ; AL = [SI], SI++
3C 20       CMP  AL, 32         ; is char less than 32
7C 10       JL   DONE           ; if so, exit
3C 5B       CMP  AL, '['        ; is char '['?
75 F7       JNZ  C_LOOP         ; if not, keep looping
AD          LODSW               ; AL = CHR_L
92          XCHG AX, DX         ; DL = CHR_L
AC          LODSB               ; AL = CHR_R
2A C2       SUB  AL, DL         ; AL = CHR_R - CHR_L
98          CBW                 ; AH = 0
40          INC  AX             ; AL = AL + 1
93          XCHG AX, BX         ; AX = multiplier
F7 E3       MUL  BX             ; multiplier *= CHR_R - CHR_L + 1 
93          XCHG AX, BX         ; BX = multiplier 
EB EA       JMP  C_LOOP         ; keep looping 
        DONE: 
C3          RET                 ; return to caller
```
As a callable function, input string in `[SI]`. Output in `BX`.
**Example test program I/O:**
[![enter image description here](https://i.stack.imgur.com/5rQN0.png)](https://i.stack.imgur.com/5rQN0.png)
[Answer]
# [CJam](https://sourceforge.net/p/cjam), 23 bytes
```
1q{('[={(\(;(@-)@*\}&}h
```
[Try it online!](https://tio.run/##S85KzP3/37CwWkM92rZaI0bDWsNBV9NBK6ZWrTbj//9oA13LWDABAA "CJam – Try It Online")
First time programming in CJam.
```
1q{('[={(\(;(@-)@*\}&}h
1q                             Push 1, then push the input, stack = [ 1, str ]
  {('[={(\(;(@-)@*\}&}h        Execute this  while the top of the stack is truthy
   ('[=                        Pop the first char and test for equality
                    &          If it is truthy...
       {(\(;(@-)@*\}           Execute this:
        (\(;(@                   Get the two values of the character class to the top of the stack
                                 E.g "0-9]..." -> "9", "0", ...                       
              -)                 Subtract 2nd element char code by first and increment, stack = [1, str, diff]
                @                Get the 1 to the top of the stack, stack = [ str, 1, diff]
                 *               Multiply top 2 elements, stack = [ str, diff ]
                  \              Swap the top 2, so the string is back on top
  {                  }h        If the string is not empty, run this again. Else print the output
```
[Answer]
# [Labyrinth](https://github.com/m-ender/labyrinth), ~~53~~ 50 bytes
```
1 @!{""
}    ;
,:_91-,,;,-
"    ;    `
""";;)~}*{)
```
**[Try it online!](https://tio.run/##y0lMqizKzCvJ@P/fUMFBsVpJiatWAQisuXSs4i0NdXV0rHV0uZTAQiAigUtJScnaWrOuVqta8///aF3d6FggERsLAA "Labyrinth – Try It Online")**
### How?
Sets the top of the auxiliary stack to 1 and consumes characters from STDIN, if these are `[` the next three characters are consumed and the top of the auxiliary stack is multiplied by one more than the difference in ordinals of the relevant two characters. Once the EOF is reached this value is printed.
```
  1 pop main (0); * 10; + 1 (=1) -> main
  } pop main -> auxiliary  (i.e. set initial cumulative product to 1)
A , read a character, C, ord(C) -> main
    3-neighbours, top of stack is non-zero so turn
  : copy top of main -> main
  _ zero -> main
  9 pop main; * 10; + 9 (=90) -> main
  1 pop main; * 10; + 1 (=91) -> main
  - pop main (a=91); pop main (b=ord(C)); b-a -> main
B   4-neighbours
    if top of main is zero (i.e. we read a '[') then go straight:
  ,   read a character, L, ord(L) -> main  (i.e. L of [L-R])
  ,   read a character, x='-', ord(x) -> main
  ;   pop main (i.e. discard the '-' of [L-R])
  ,   read a character, R, ord(R) -> main  (i.e. R of [L-R])
  -   pop main (a=ord(R)); pop main (b=ord(L)); b-a -> main
  `   pop main; negate -> main
  )   pop main; increment -> main  (i.e. ord(R)-ord(L)+1)
  {   pop auxiliary -> main  (i.e. get current cumulative product)
  *   pop main (a); pop main (b); b*a -> main
  }   pop main -> auxiliary  (i.e. set new cumulative product)
  ~   pop main (0); bitwise NOT (~0=-1) -> main
  )   pop main; increment -> main
      3-neighbours, top of stack is zero so go straight
  ;   pop main (i.e. discard the zero, leaving infinite zeros on main)
  ;   pop main (i.e. discard another zero, sill leaving infinite zeros on main)
  """" no-ops taking us back to the first , instruction at "A"
B   elif top of main is negative (i.e. we read something <'[') then turn left:
  ;   pop main (i.e. discard the result)
  "   no-op
C     3-neighbours
      if top of main (the duplicate of ord(C)) is negative (i.e. EOF) then turn left:
  {     pop auxiliary -> main  (i.e. get cumulative product)
  !     pop main; print as decimal
  @     exit program
C     elif top of main is positive then turn right:
  "     no-op
        we hit a wall so turn around
  "     no-op
        3-neighbours, top of stack is non-zero so turn
  ;     pop main (i.e. discard this leaving infinite zeros on main)
  -     pop main (a=0); pop main (b=0); b-a=0 -> main
        4-neighbours (same location as B but facing down), top of main is zero so go straight
  ;     pop main (i.e. discard one of the infinite zeros off of main)
  )     pop main; increment (=1) -> main
        3-neighbours, top of stack is positive so turn right
  ;     pop main (i.e. discard this 1)
  ;     pop main (i.e. discard one of the infinite zeros off of main)
  """"  no-ops taking us back to the first , instruction at "A"
C     (N.B. elif top of main is zero cannot happen)
B   elif top of main is positive (i.e. we read something >'[') then turn right:
  ;   pop main (i.e. discard the result)
  )   pop main (duplicate of ord(C)); increment -> main
      3-neighbours top of main is positive so turn right:
  ;   pop main (i.e. discard that)
  ;   pop main (i.e. discard one of the infinite zeros off of main)
  """"  no-ops taking us back to the first , instruction at "A"
```
The complicated 4-neighbour `-`, along with the dead-end `"`, is a 3 byte save over the easier to follow:
```
1
}
,:_91-,,;,-
;    ;    `
""""")~}*{)
     {
    @!
```
[Answer]
# [Julia 1.0](http://julialang.org/), ~~62~~ 60 bytes
```
s->prod(map(x->x[2][1]-x[1][1]+1,eachmatch(r"\[(.)-(.)",s)))
```
-2 bytes thanks to [Robin Ryder](https://codegolf.stackexchange.com/users/86301/robin-ryder)
[Try it online!](https://tio.run/##yyrNyUw0rPifZvu/WNeuoCg/RSM3sUCjQteuItooNtowVrcCSACRtqFOamJyRm5iSXKGRpFSTLSGnqYuECvpFGtqav4vKMrMK8nJ00jTUIpO1K2KTYl2BJJKmppcyDIGukCzyCOARv0HAA "Julia 1.0 – Try It Online")
[Answer]
# [Burlesque](https://github.com/FMNSSun/Burlesque), 29 bytes
```
"\[.-."~?{)**{3 1}si^p.-+.}mp
```
[Try it online!](https://tio.run/##nY7RCsIwDEXf/YqtD4KTlMy56UAm/oA/UCN0thNhk@kYgmP@ei0t6rsvNzn3JiFlf691d@u1qa/DQ2EYttqwg@DA2Ws7zKJoSIJ47C7HlsOcj01rRmr6vWEsgCKIJ0x@GhEBkoOVBYScnPgY0XoSnqTEzqo3U1xbdwOF58RCCFMPmQVlJ2VZuVqdnZ0uchsIoN@KBEmihJJOSgsAoO9DCDH9Ke7GEvPsDQ "Burlesque – Try It Online")
```
"\[.-."~?  # List of all RegEx matches
{
 )**         # Ord()
 {3 1}si     # Select values at indices 3 & 1 (start,end)
 ^p          # Unbox
 .-          # Difference
 +.          # Increment
}mp          # Map product (returns 1 for empty)
```
# [Burlesque](https://github.com/FMNSSun/Burlesque), 24 bytes
```
s1r1{@\x01\x7fr\jCB}\m{g1~=}fl
```
[Try it online!](https://tio.run/##SyotykktLixN/f@/2LDIsNqBsb4oJsvZqTYmtzrdsM62Ni3n///oRN2qWAA "Burlesque – Try It Online")
Solution that generates all possible strings and counts the number of matches.
WARNING: May take infinite time and memory.
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 31 bytes
```
≔⪪⮌Ｓ¹θ≔¹ηＷθＦ⁼⊟θ[≧×Ｌ…·⊟θ∧⊟θ⊟θηＩη
```
[Try it online!](https://tio.run/##PU6xCoMwEN37FaHTHcTB2UlKh0ILot3EIdhrEkhjTKL9/DRicbh37x33eG9Uwo@TMCnVIWhpoXNGR2hpJR8IbtYtsYteWwmInJV5ZqxO/@eSM5XVV2lDDGZk78kzuM6LMAGayeUTZ@f@jMgewu2mVksV4ak/FDi7k5VR5ZjRLEGv1Aor6XDW9nXwfeNWYotscqUIFxEiKMQqpb4o@iHDMKRiNT8 "Charcoal – Try It Online") Link is to verbose version of code. Explanation:
```
≔⪪⮌Ｓ¹θ
```
Input the pattern string, reverse it, and split it into individual characters. This allows characters to be consumed within an expression by using `Pop(q)`.
```
≔¹η
```
Start off with 1 matching string.
```
Ｗθ
```
Repeat until all of the input characters have been processed.
```
Ｆ⁼⊟θ[
```
Is this a character range?
```
≧×Ｌ…·⊟θ∧⊟θ⊟θη
```
If so then multiply the result by the length of the inclusive range between the next character and the next but three (this saves a byte over converting to ordinals manually). The characters are consumed so that a range that starts or ends at `[` does not get misinterpreted as a second range.
```
Ｉη
```
Output the result.
]