[Question]
  [
# [Oreoorererereoo](https://i.redd.it/kqibcu69xm721.jpg)
Given an input string that is similar to the word "oreo", give an ASCII representation of the cookie that is as wide as the input string (to ensure cookie stability). 
## Rules
* The input is lowercase, a non-empty string with no whitespace containing any combination of the strings "o" and "re", and containing only those strings.
* The string "o" represents the solid cookie, while the string "re" represents the filling.
* The output must be a stacked cookie that is as wide as the input string.
* The output may not be an array of strings
* The cookie must overlap the filling by one character on each side
* The characters used for the output don't have to match the output below (█ and ░), they just have to be different non-whitespace characters for the two parts of the cookie
* The whitespace padding on the left side of the filling is required, and any trailing whitespace is optional
## Examples
```
Input: oreo
Output:
████
 ░░ 
████
Input: o
Output:
█
Input: re
Output: (two spaces)
Input: rere
Output:
 ░░ 
 ░░ 
Input: oreoorererereoo
Output:
███████████████
 ░░░░░░░░░░░░░ 
███████████████
███████████████
 ░░░░░░░░░░░░░ 
 ░░░░░░░░░░░░░ 
 ░░░░░░░░░░░░░ 
 ░░░░░░░░░░░░░ 
███████████████
███████████████
```
Since this is code golf the shortest answer wins, good luck :)
  
[Answer]
# [Pepe](https://esolangs.org/wiki/Pepe), 364 bytes
Unfortunately the online interpreter does not take care of compressing comments, hence all `o` characters will be replaced by a space.. Neither the spaces nor the `o` are necessary, so this could be 295 bytes, but I like it more this way:
```
rEeEEeeEeEororEEoreoreeeEeeeeeorEEEEeoREeoreorEeEEeEEEEororEEoreorEEEEEoREeoreorEeEEEeeEeororEEoreoReoREoREEEeoREEEEEoreorEorEEEeorEEEEEoreEoREeoreoREEeoREEEEeEeeoREEEeoREeeEoREEEeoREEEEEEEorEEEeEorEEEeoREoREEEeoREEEEEoREEoReoreorEEEeEoREEEEEEeorEEEeoReEoREoREEEeoREEoReoroReEeoREoREEEeorEEEEeoReeoREEEeoREeeEoREEEeoREEEEEEEoreoReoReoREoREEEeoREEEEEoreeeeeEeEeoRee
```
[Try it online!](https://soaku.github.io/Pepe/#!ca@E$U8-gD$!cu@E$-iD$!d0@E$.&!p-j$_!o-iAD$TRt!p!f!pE7-e!o&!p-jF.$-eE5!oB&!pF.@L&!p-g/!p!f!pE7$..&!p-jT0/ "Pepe – Online interpreter")
## Ungolfed
There might be some golfing oppurtunities with *flags* which I missed, but I'm done for now:
```
# "function" for 'e'
rEeEEeeEeE rrEE
  re          # remove duplicated argument
  reeeEeeeee  # print space
  rEEEEe      # decrement counter twice
REe re
# "function" for 'o'
rEeEEeEEEE rrEE
  re      # remove duplicated argument
  rEEEEE  # increment counter
REe re
# "function for 'r'
rEeEEEeeEe rrEE
  re Re              # remove duplicated argument & char
  RE REEEe REEEEE    # push 1
  re rE rEEEe rEEEEE # replace 1
  reE                # goto 1
REe re
# Main
REEe REEEEeEee                # read input & reverse
REEEe REeeE REEEe REEEEEEE    # push length-1 & move to r
rEEEeE rEEEe # dummy loop-var (fucking do-whiles...)
RE REEEe REEEEE REE  # while [label-1]
  # Call the right procedure depending on current character,
  # sets stacks up as follows:
  #   R [ .... *currentChar ]
  #   r [ (N-1) *count ]
  Re re          # pop 1 & loop-counter
  rEEEeE         # duplicate counter
  REEEEEEe rEEEe # copy current char to other stack
  ReE            # jeq to 'o'-label or 'e'-label
  # Output currentChar count times:
  RE REEEe REE # while [label-0]:
    Re         #   pop 0
    rReEe      #   print character
    RE REEEe   #   push 0
    rEEEEe     #   decrement counter
  Ree
  REEEe REeeE REEEe REEEEEEE  # push length-1 & move to r
  re Re Re                    # pop 0, counter and 9((((currentChar
  RE REEEe REEEEE             # push 1
  reeeeeEeEe                  # print new-line
Ree
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~16 14~~ 13 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
-1 Thanks to Erik the Outgolfer
```
OḂƇẒṁ€aØ.¦€⁶Y
```
Uses `1` for the cream and `0` for the cookie.
**[Try it online!](https://tio.run/##y0rNyan8/9//4Y6mY@0Pd016uLPxUdOaxMMz9A4tAzIeNW6L/P//v3p@UWo@EENgfr46AA "Jelly – Try It Online")**
### How?
```
OḂƇẒṁ€aØ.¦€⁶Y - Main Link: list of characters, V    e.g. 'orereo'
O             - ordinal (vectorises)                     [111,114,101,114,101,111]
  Ƈ           - filter keep those for which:
 Ḃ            -   modulo 2                               [111,    101,    101,111]
   Ẓ          - is prime? (vectorises)                   [  0,      1,      1,  0]
    ṁ€        - mould each like V                        [[0,0,0,0,0,0],[1,1,1,1,1,1],[1,1,1,1,1,1],[0,0,0,0,0,0]]
          €   - for each:
         ¦    -   sparse application...
       Ø.     -   ...to indices: literal [0,1] (0 is the rightmost index, 1 is the leftmost)
      a       -   ...apply: logical AND with:
           ⁶  -               space character           [[0,0,0,0,0,0],[' ',1,1,1,1,' '],[' ',1,1,1,1,' '],[0,0,0,0,0,0]]
            Y - join with newline characters            [0,0,0,0,0,0,'\n',' ',1,1,1,1,' ','\n',' ',1,1,1,1,' ','\n',0,0,0,0,0,0]
              - implicit print                       ...smashes everything together:
              -                                         000000
              -                                          1111 
              -                                          1111 
              -                                         000000
```
---
Previous 16 byter:
```
ḟ”eẋ€Ly@Ø.¦€⁾r Y
```
Uses `r` for the c`r`eam and `o` for the c`o`okie.
[Try it online!](https://tio.run/##y0rNyan8///hjvmPGuamPtzV/ahpjU@lw@EZeoeWAZmPGvcVKUT@//9fPb8oNR@IITA/Xx0A "Jelly – Try It Online")
[Answer]
# [Canvas](https://github.com/dzaima/Canvas), ~~19~~ ~~18~~ 17 [bytes](https://github.com/dzaima/Canvas/blob/master/files/chartable.md)
```
e ∙╋
：r≠＊┤］；Ｌ×⁸↔⁸
```
[Try it here!](https://dzaima.github.io/Canvas/?u=ZSUyMCV1MjIxOSV1MjU0QiUwQSV1RkYxQXIldTIyNjAldUZGMEEldTI1MjQldUZGM0QldUZGMUIldUZGMkMlRDcldTIwNzgldTIxOTQldTIwNzg_,i=b3Jlb29yZXJlcmVyZW9v,v=8)
Uses the annoyingly long code of `：r≠＊┤］` to remove `r`s from the input..
[Answer]
# [Japt](https://github.com/ETHproductions/japt) [`-R`](https://codegolf.meta.stackexchange.com/a/14339/58974), ~~16~~ 15 bytes
```
re ¬£çX sX²èrÃû
```
[Try it](https://ethproductions.github.io/japt/?v=1.4.6&code=cmUgrKPnWCBzWLLocsP7&input=Im9yZW9vcmVyZXJlcmVvbyIKLVI=)
```
                    :Implicit input of string U
re                  :Remove all "e"s
   ¬                :Split to array of characters
    £               :Map each X
     çX             :  Repeat X to the length of U
        s           :  Slice from index
         X²         :   Duplicate X
           èr       :   Count the occurrences of "r"
             Ã      :End map
              û     :Centre pad each element with spaces to the length of the longest
                    :Implicitly join with newlines and output
```
---
## Alternatives
```
re ¬ËpUÊaD²èrÃû
re ¬£îX rr²i^Ãû
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~18~~ ~~17~~ 16 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
'eKεD'rQ2*Igα×}.c
```
-1 byte thanks to *@Emigna*
Uses `o` for the cookie and `r` for the filling.
[Try it online](https://tio.run/##yy9OTMpM/f9fPdX73FYX9aLAQ9s9089tPDy9Vi/5///8otR8IIbA/HwA) or [verify all test cases](https://tio.run/##yy9OTMpM/V9TpuSZV1BaYqWgZF95eEKojpJ/aQmEr/NfPdX73FYX9aLAQ9sj0s9tPDy9Vi/5v86hbfb/84tS87nyuYpSgQhI5IPIfBCVD2aCufkA).
**Explanation:**
```
'eK                 '# Remove all "e" from the (implicit) input
                     #  i.e. "orereo" → "orro"
   ε         }       # Map all characters to:
    D                #  Duplicate the current character
     'rQ            '#  Check if it's an "r" (1 if truthy; 0 if falsey)
                     #   i.e. "r" → 1
                     #   i.e. "o" → 0
        ·            #  Double that
                     #   i.e. 1 → 2
                     #   i.e. 0 → 0
         Ig          #  Take the length of the input
                     #   i.e. "orereo" → 6
           α         #  Take the absolute difference between the two
                     #   i.e. 2 and 6 → 4
                     #   i.e. 0 and 6 → 6
            ×        #  Repeat the duplicated character that many times
                     #   i.e. "r" and 4 → "rrrr"
                     #   i.e. "o" and 6 → "oooooo"
              .c     # Then centralize it, which also imlicitly joins by newlines
                     # (and the result is output implicitly)
                     #  i.e. ["oooooo","rrrr","rrrr","oooooo"]
                     #   → "oooooo\n rrrr\n rrrr\noooooo"
```
[Answer]
# [C# (Visual C# Interactive Compiler)](http://www.mono-project.com/docs/about-mono/releases/5.0.0/#csc), 95 bytes
```
n=>n.Replace("o",new String('-',n.Length)+"\n").Replace("re"," ".PadRight(n.Length-1,'|')+"\n")
```
[Try it online!](https://tio.run/##Sy7WTS7O/O9WmpdsU1xSlJmXrgOh7BJt/@fZ2uXpBaUW5CQmp2oo5Svp5KWWKwSDpTXUddV18vR8UvPSSzI0tZVi8pQ0EUqLUpV0lBSU9AISU4Iy0zNKNGAqdQ111GvUoer/W4cXZZakaiSCNWhqWv8HAA "C# (Visual C# Interactive Compiler) – Try It Online")
# Alternative using Aggregate, 108 bytes
```
n=>n.Aggregate("",(d,c)=>d+(c<102?"":c<112?new String('-',n.Length)+"\n":" ".PadRight(n.Length-1,'|')+"\n"))
```
[Try it online!](https://tio.run/##NY2xDsIgGIRfpfkXIAUiHdtC4@LkYHRwcSFAKMtvQjEuvjsSG6e7y3eXc5twW6qnF7p5Kzlh5LsYqytqg/IYYw7RlkABOPXcMW18T92sDsMCMDajhgXDu7v9hpQIwlGeA8aysh4eCCN0IC/WX1NcC/0zoTj5kL3BWJ3uObUTS@HZ4lS/ "C# (Visual C# Interactive Compiler) – Try It Online")
[Answer]
# [R](https://www.r-project.org/), 106 bytes
```
function(s,N=nchar(s)){m=rep(el(strsplit(gsub('re',0,s),'')),e=N)
m[m<1&seq(m)%%N<2]=' '
write(m,1,N,,"")}
```
[Try it online!](https://tio.run/##jc5BCsIwEAXQfU4hgTozMIJ1ba6QC6iLWqZaaJo6SXEhnj2StZv@v33wv5bBlWGd@zzGGRN7N/fPTjERfYJTWVAmTFnTMo0ZH2m9I6gAHzkRAxCxOE8mXMK53Sd5YaCm8efTzcEOzFvHLBi4Zc9sLX3LgDaqREum7zLC4T/XGchUtsGobEKbWL0Vq62Ndb38AA "R – Try It Online")
* -12 bytes thanks to @Giuseppe
---
Previous version with explanation :
# [R](https://www.r-project.org/), 118 bytes
```
function(s,N=nchar(s)){m=t(replicate(N,el(strsplit(gsub('re',0,s),''))))
m[m<1&row(m)%in%c(1,N)]=' '
write(m,1,N,,'')}
```
[Try it online!](https://tio.run/##jc7BCsIwDAbge59CBjMJRHB3@wp7AfUwS6eFtZW0Ywfx2Wt79rI/t5@PJFJmXeY1mOxiwMSjDuY1CSaij9cZxb4XZ6ZscWS7YMqSapHxmdYHgljgMydiAKpR/uovw1Hihp56F3qDA49013AAtYmrWzzXhpv/lhm7KDZ2pOoBhNN/bgFINbbDiN2FdrH2Vmy2TWzXyw8 "R – Try It Online")
* -1 byte thanks to @Giuseppe
Unrolled code and explanation :
```
function(s){                       # s is the input string, e.g. 'oreo'
  N = nchar(s)                     # store the length of s into N, e.g. 4
  s1 = gsub('re',0,s)              # replace 're' with '0' and store in s1, e.g. 'o0o'
  v = el(strsplit(s1,''))          # split s1 into a vector v of single characters
                                   # e.g. 'o','0','o'
  m = replicate(N,v)               # evaluate N times the vector v and arrange 
                                   # the result into a matrix m (nchar(s1) x N)
                                   # e.g. 
                                   # 'o' 'o' 'o' 'o' 
                                   # '0' '0' '0' '0' 
                                   # 'o' 'o' 'o' 'o' 
  m = t(m)                         # transpose the matrix
  m[m<1 & row(m)%in%c(1,N)] = ' '  # substitute the zeros (i.e. where < 1) 
                                   # on the 1st and last row of the matrix with ' ' (space)
                                   # e.g. 
                                   # 'o' ' ' 'o' 
                                   # 'o' '0' 'o' 
                                   # 'o' '0' 'o' 
                                   # 'o' ' ' 'o'
  write(m,1,N,,'')                 # write the matrix to stdout (write function transposes it)
                                   # e.g.
                                   # oooo
                                   #  00 
                                   # oooo
}
```
[Answer]
# [Retina](https://github.com/m-ender/retina/wiki/The-Language), ~~21~~ 19 bytes
```
L$`.
$.=*$&
r+¶ee
 
```
[Try it online!](https://tio.run/##K0otycxLNPyvquGe8N9HJUGPS0XPVktFjatI@9C21FQuhf//84tS87m4gKgoFYRBJEgoH8QEwfx8AA "Retina – Try It Online") Link includes test cases. Explanation:
```
L$`.
$.=*$&
```
List each letter on its own line repeated to the length of the original input.
```
r+¶ee
 
```
Remove the lines of `r`s and replace the first two `ee`s on the next line with a space.
Edit: Saved 2 bytes thanks to @DomHastings.
[Answer]
# [Perl 5](https://www.perl.org/) `-p`, 47 bytes
```
s|o|X x($i=y///c).$/|ge;s|re|$".O x($i-2).$/|ge
```
[Try it online!](https://tio.run/##K0gtyjH9/7@4Jr8mQqFCQyXTtlJfXz9ZU09FvyY91bq4pii1RkVJzx8sp2sEFf//P78oNR@IITA//19@QUlmfl7xf90CAA "Perl 5 – Try It Online")
[Answer]
# [Retina](https://github.com/m-ender/retina/wiki/The-Language), ~~74~~ 73 bytes
I feel like I haven't posted an answer in a very long time. Well, here I am. Also, Retina has changed a lot, and I feel like I suck at it now.
```
.+
$0$.0
(\d+)
*
e
o|r
$&¶
_$
+(/_/&`o¶
oo¶
_$
)/_/&`r¶
rr¶
¶$
m`^r
 
```
[**Try it online!**](https://tio.run/##K0otycxLNPz/X0@bS8VARc@ASyMmRVuTS4srlYsrv6aIS0Xt0DaueBUuLm0N/Xh9tYR8IDc/HyqmCRYqAvKKQMShbUCx3IS4Ii6F///zi1LzgRgC8/MB "Retina – Try It Online")
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~135~~ ~~113~~ ~~109~~ 104 bytes
* Saved ~~twenty-two~~ twenty-seven bytes thanks to [NieDzejkob](https://codegolf.stackexchange.com/users/55934/niedzejkob).
* Saved four bytes thanks to [ceilingcat](https://codegolf.stackexchange.com/users/52904/ceilingcat).
```
#define $ putchar(33
O(char*r){for(char*e,*o=r,x;*r;$-23))for(x=*r++>111,e=x?$-1),r++,o+2:o;*e++;$+x));}
```
[Try it online!](https://tio.run/##Rc1BCoMwEAXQdT2FpFlkkihEd021R/AIImlsXdQp0xYC4tmtQVqZzePPMN9lN@eW5Xj1/TD6lKfPz9vdOxJlmTQiShJMPdJmryVWpIOVZHlWlABxFSpJStXGGO2rcOGZAb0GGlVxQiu9UparAGDnf1Fr16KXYOe8zWsGNnl0wyhgSg6NYEgeGbSbfyC/a3c8xRjEQYyf5uUL "C (gcc) – Try It Online")
[Answer]
# JavaScript, ~~72~~ ~~65~~ 64 bytes
```
s=>s.replace(/.e?/g,([x,y])=>(y?`
 `:`
`).padEnd(s.length+!y,x))
```
[Try it online](https://tio.run/##lc6xCoMwFIXhWZ/CZkpojHtBnXyKWkjQq20JuSGRYp4@xRRKoYue@fvhPNVL@cE97FIaHCFOdfR144UDq9UAtBLQVjOn15WHG6sbGlqZF/Iic8mEVWNnRuqFBjMv9/Mp8JWxOKDxqEFonGk2UYIOkLAs46Q3vSm/Iyz/pUWyG9wlHRygH7zrwIbxgMZUpGrL/qv4Bg)
[Answer]
# JavaScript ES6, 103 bytes
### Using replace 103 bytes:
```
x=>x.replace(/o/g,"-".repeat(s=x.length)+`
`).replace(/re/g," "+"|".repeat(s>1?s-2:0)+` 
`).slice(0,-1)
```
[Try it online!](https://tio.run/##dcyxCsMgEIDhPU8RnJREk3QsJH2ViL3YFPGCSnHou1ulQ6BYXI7/vvMpX9Irtx@BW7xD2uYU5yUKB4eRCuiAg@4JJyWADNTPURiwOjxYtzYrO6GDIlvSkfepl@nm@eU6ZtwW7c2e7djziSWF1qMBYVDTjRJ0gISx5jdXmoNqxD@9vNrP@QK/2zJlkT4 "JavaScript (Node.js) – Try It Online")
### Using split and map 116 bytes:
```
x=>x.split("re").map(y=>("-"[h='repeat'](r=x.length)+`
`)[h](y.length)).join(" "+"|"[h](r>1?r-2:0)+` 
`).slice(0,-1)
```
[Try it online!](https://tio.run/##dY5BCoMwEEX3PYXMxgk2QbssxB5EBIONGkkzIUpR6N1tpHRTLLMZ3n8z/FE91dQG42fu6K63Tm6LLBcxeWtmhKCBiYfyuMoSgUM1yDRor9Wc1hjkIqx2/TywrDk1rBpqXL@EiZGMQ0gggxfsUSiLW@CXax7tJOpisqbVmJ95wbaW3ERWC0s9dggUNAFjp198wPaKB5D@8H2OPscL@qT7Fo3tDQ "JavaScript (Node.js) – Try It Online")
[Answer]
# [Python 3](https://docs.python.org/3/), 77 bytes
```
lambda x:x.replace("o","-"*len(x)+"\n").replace("re"," "+'.'*(len(x)-2)+"\n")
```
[Try it online!](https://tio.run/##K6gsycjPM/6fZhvzPycxNyklUaHCqkKvKLUgJzE5VUMpX0lHSVdJKyc1T6NCU1spJk9JEyFZlAqUVVDSVtdT19KAKNE1gqr6nwbUXJSaD2QBAA "Python 3 – Try It Online")
[Answer]
# Mathematica, ~~111~~ 91 bytes
```
#~StringReplace~{"o"->"O"~Table~(n=StringLength@#)<>"\n","re"->" "<>Table["R",n-2]<>" \n"}&
```
[Try It Online!](https://tio.run/##y00syUjNTSzJTE78H1CUmVcS/V@5LrgEyEoPSi3ISUxOratWylfStVPyV6oLSUzKSa3TyLOFKPBJzUsvyXBQ1rSxU4rJU9JRKkoFKVRQsrEDq4xWClLSydM1igXKKwAV1Kr9V3BQUMovSgXBfCCdrxT7HwA)
This was majorly shortened thanks to [Misha](https://codegolf.stackexchange.com/users/74672/misha-lavrov)'s [edits](https://codegolf.stackexchange.com/questions/178344/oreoorererereoo/178418#comment430012_178418).
---
My original code:
```
(z=StringRepeat;n=StringLength@#;#~StringReplace~{"o"->"O"~z~n<>"\n","re"->" "<>If[n>2,z["R",n-2],""]<>" \n"})&
```
This code is not very fancy but it seems too expensive to convert away from strings and then back or to do anything else clever.
In particular, with only 3-4 commands that have the name String, my original approach couldn't save bytes at all by trying to abstract that away. For example, the following is 129 bytes:
```
(w=Symbol["String"<>#]&;z=w@"Repeat";n=w["Length"]@#;#~w@"Replace"~{"o"->"O"~z~n<>"\n","re"->" "<>If[n>2,z["R",n-2],""]<>" \n"})&
```
[Answer]
# Bash, 87 bytes
Without `sed`:
```
f(){ printf %$1s|tr \  $2;}
c=${1//o/`f ${#1} B`
}
echo "${c//re/ `f $[${#1}-2] F` 
}"
```
Thanks to @manatwork.
With `sed` (90 bytes):
```
f(){ printf %$1s|tr \  $2;}
echo $1|sed "s/o/`f ${#1} B`\n/g;s/re/ `f $[${#1}-2] F` \n/g"
```
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), 37 bytes
```
{m:g/o|r/>>.&({S/rr/ /.say}o*x.comb)}
```
[Try it online!](https://tio.run/##K0gtyjH7n1upoJamYKvwvzrXKl0/v6ZI385OT02jOli/qEhfQV@vOLGyNl@rQi85PzdJs/a/TX5Rar5CvkJRKhABCRA3H8QCwfx8O5DmtP8A "Perl 6 – Try It Online")
Anonymous code block that takes a string and prints the oreo, with `o` as the cookie and `r` as the cream.
### Explanation:
```
{                                   }   # Anonymous code block
 m:g/o|r/                               # Select all o s and r s
         >>.&(                     )    # Map each letter to
                            *x.comb     # The letter padded to the width
               S/rr/ /                  # Substitute a leading rr with a space
                      .say              # And print with a newline
```
[Answer]
# [PHP](https://php.net/), ~~100~~ ~~99~~ 93 bytes
```
$l=strlen($i=$argv[1]);$r=str_repeat;echo strtr($i,[o=>$r(X,$l)."
",re=>' '.$r(o,$l-2)."
"]);
```
[Try it online!](https://tio.run/##JYzBCsIwEETvfkUoC00gFvUaU39DKCJFlqYQumEM/n7cKsMc5vGYkkq73koqhgHBE1wEdd0We3KhUY7visybpTXSjOUznR8uEHa8uzzXwK8kRneFWn6SOBLs3VN2Q3foPDiOvekHhaLwePlhfWmtCVi0/4h8AQ "PHP – Try It Online")
OUCH. PHP's waaaay\_too\_long function names strike again!
Output:
```
$php oreo.php oreo
XXXX
 oo
XXXX
$php oreo.php o
X
$php oreo.php rere
 oo
 oo
$ php oreo.php oreoorererereoo
XXXXXXXXXXXXXXX
 ooooooooooooo
XXXXXXXXXXXXXXX
XXXXXXXXXXXXXXX
 ooooooooooooo
 ooooooooooooo
 ooooooooooooo
 ooooooooooooo
XXXXXXXXXXXXXXX
XXXXXXXXXXXXXXX
```
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 28 bytes
```
FNzIqN"o"*lzN)IqN"r"+d*-lz2N
FNz                              For each value, N, in input
   IqN"o"                        if the character is "o"
         *lzN                    return the character times the length of the input
             )                   end if
              IqN"r"             if the character is "r"
FNzIqN"o"*lzN)IqN"r"+d*-lz2N
                        *-lz2N   return the character times length - 2
                    +d           padded on the left with " "
```
[Try it here!](https://tio.run/##K6gsyfj/382vyrPQTylfSSunyk8TxCxS0k7R0s2pMvL7/z@/KDUfiCEwPx8A) This one uses a loop.
# Pyth, 30 bytes
(As string replace)
```
::z"o"+*lz"="b"re"++d*-lz2"~"b
 :z"o"                           With the input, replace "o" with
       *lz"="                    "=" times the length of the input
      +      b                   and a newline added to the end
:             "re"               With the input, replace "re" with
                     *    "~"    "~" times
                      -lz2       the length of the input minus 2
                   +d            padded on the left with " "
                  +          b   and a newline added to the end
```
[Try it here!](https://tio.run/##K6gsyfj/38qqSilfSVsrp0rJVilJqShVSVs7RUs3p8pIqU4p6f///KLUfCCGwPx8AA) This one uses string replacement.
I really like python (it's what I wrote my original test scripts in), so I thought I'd do a pyth entry for fun :)
[Answer]
# [PHP](https://php.net/), 96 87 85 bytes
Thanks to @gwaugh -9 Bytes  
Thanks to @manatwork -2 Bytes
```
<?=strtr($i=$argv[1],[o=>($r=str_repeat)(X,$l=strlen($i))."
",re=>" {$r(o,$l-2)}
"]);
```
[Try it online!](https://tio.run/##JcvBCoMwEATQu18hIYddSEvbq038DUGkeFhUEDdMQy/Fb08TCnOaNxPXmJ99XGMrgOIFiYq0HQvduOtDMf9OSCC7eTtj@Yz3yY3qA1lUqQeZE9Pg7F6LXY6yZb6axjiID6b9WpAWvjz4bMzEXc5ZIf9Afg "PHP – Try It Online")
[Try it online! (87 Bytes)](https://tio.run/##HcvBCoMwEIThe58iyIJZiNL2ahNfoyBSPCwqiBumoa@fJl7/byZuMb/GuEUjgOIDiYq0n6u982DGUNB/ExIs7Z4WrL/pMbtJfbCEKvUhS2L7dnTUcMhZtsx9c2scxIfWtD3BavHueeWZh5yzQvQP "PHP – Try It Online")
[Try it online (original 97 bytes submition)!](https://tio.run/##K8go@M/538betrikqKRIQ6XcViWxKL0s2jBWJzrf1k5DJQ0kE1@UWpCaWKKp8Whah45KDkgoJzUPqFpTU0@JS0mnyNZOSUFJTyUNqGAiUIGuEUQ8FSiuFKtp/f////yi1HwghsD8fAA "PHP – Try It Online")
---
**And a recursive function**
# [PHP](https://php.net/), 135 bytes
```
function f($w,$x=0){$f=str_repeat;echo($x<($l=strlen($w)))?($w[$x]=='o')?$f(█,$l)."
".f($w,$x+1):" ".$f(░,$l-2)."
".f($w,$x+2):"";}
```
[Try it online! (recursive)](https://tio.run/##K8go@G9jXwAk00rzkksy8/MU0jRUynVUKmwNNKtV0myLS4rii1ILUhNLrFOTM/I1VCpsNFRyQMI5qXlAlZqamvZAKlqlItbWVj1fXdNeJU3j0bQOHZUcTT0lLiU9qHHahppWSgpKemDZiUBZXSNUeSOgvJJ17f80DaX8otR8JU3r//8B "PHP – Try It Online")
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~62~~ 60 bytes
```
->s{s.gsub /./,?r=>" #{(?**z=s.size)[0..-3]}
",?o=>?O*z+?\n}
```
[Try it online!](https://tio.run/##JYlBDsIgFET3noLgRhF@G10a@EfwAMjCGqpuioGyEMrZMbSZ5M2bjI/Dr46yChVygFeIA@mg4@ilomSfD8hYkgHCJ9mj7gHExZQd5eikwhtLJ7xPpWrqvHWUE7rC241bt8u10eIcNWAfz3de5uUb50BGPZsrWRUFO/el/gE "Ruby – Try It Online")
Uses `O` for the cookie, `*` for the filling.
-1 thanks to @manatwork pointing out a silly mistake and another -1 due to relaxation of the rules about whitespaces.
[Answer]
# Powershell, ~~71~~ ~~69~~ 66 bytes
*-2 bytes thanks @Veskah*
*-3 bytes thanks @AdmBorkBork*
```
$l=$args|% le*
switch($args|% t*y){'o'{'#'*$l}'r'{" "+'%'*($l-2)}}
```
Less golfed test script:
```
$f = {
$l=$args|% length
switch($args|% t*y){
    'o'{'#'*$l}
    'r'{" "+'%'*($l-2)}
}
}
@(
,(
'oreo',
'####',
' %%',
'####'
)
,(
'o',
'#'
)
,(
're',
' '
)
,(
'rere',
' %%',
' %%'
)
,(
'oreoorererereoo',
'###############',
' %%%%%%%%%%%%%',
'###############',
'###############',
' %%%%%%%%%%%%%',
' %%%%%%%%%%%%%',
' %%%%%%%%%%%%%',
' %%%%%%%%%%%%%',
'###############',
'###############'
)
) | % {
    $s,$expected = $_
    $result = &$f $s
    "$result"-eq"$expected"
    # $result # uncomment this line to display a result
}
```
Output:
```
True
True
True
True
True
```
[Answer]
# Java 11, ~~110~~ 106 bytes
```
s->{int l=s.length();return s.replace("re"," "+"~".repeat(l-2+1/l)+"\n").replace("o","=".repeat(l)+"\n");}
```
-4 bytes thanks to *@ceilingcat*.
Uses `=` for the cookie and `~` for the filling.
[Try it online.](https://tio.run/##ZZDBTgMhEIbvfYoJJ8i6GL1u1jewlx7VA9KxUilsYLaJadZXX2cpsVovhPn@n5l/2Jujaffbj9l6kzM8GhdOKwAXCNObsQjrpQTYUHJhB1bWS1Yd82nFRyZDzsIaAvQw5/bhxK/B91l7DDt6l6pLSGMKkHXCwXNXKRKKGwGiEV9igWhI@va@ubv1qhHPQaiLNbKzv7iq3k1zt0wfxlfP02uIY3RbOPASNefTCxh13oAwEzdLGEXJ/kP@lhzsqr4mcUHxH4uFF62Kv3@nBCve@oEuDCPVaJvPTHjQcSQ9sEg@yKCtPFtqq2n@Bg)
**Explanation:**
```
s->{                       // Method with String as both parameter and return-type
  int l=s.length();        //  Get the length of the input
  return s                 //  Return the input
          .replace("re",   //  After we've replaced all "re" with:
            " "            //   A space
            +"~".repeat(l-2+1/l)
                           //   Appended with length-2 amount of "~"
                           //   (or length-1 if the input-length was 1)
            +"\n")         //   Appended with a newline
          .replace("o",    //  And we've also replaced all "o" with:
            "=".repeat(l)  //   Length amount of "="
            +"\n");}       //   Appended with a newline
```
---
The above solution uses a replace. The following maps over the characters of the input instead:
# Java 11, ~~113~~ 112 bytes
```
s->s.chars().forEach(c->{if(c>101)System.out.println((c>111?" ":"")+(""+(char)c).repeat(s.length()-2*(~c&1)));})
```
-1 byte thanks to *@Neil*.
[Try it online.](https://tio.run/##bZAxT8MwEIX3/oqTB3RHFYswEjVMjHTpiBiM6zQuqR3Zl0qoCn89JE6EoLBYeu9ZT9@9ozqr7Lh/H3SjYoRnZd1lBWAdm1ApbWA7SYCzt3vQuONg3QEiFaPbr8YnsmKrYQsONjDErIxS1ypEJFn58KR0jTorL7ZCXeZ3Oe0@IpuT9B3LduzixuGU5PmjAPEgBK1RiDVOHaRJBtMaxRhlY9yBa6Ts/hY/9U1OREVPQzExtN1bMzIsKAn1NB6y0L68gqL5CjaRUfhgvEgXfDu/ZTDX@trxk@X/eD75KVvCnxslsPR3mdG6tuMFzUmNs547/9lpKeyHLw)
**Explanation:**
```
s->                           // Method with String parameter and no return-type
  s.chars().forEach(c->{      //  Loop over the characters as codepoint-integers
    if(c>101)                 //   If it's not an 'e':
      System.out.println(     //    Print with trailing newline:
       (c>111?                //     If it's an 'r'
         " "                  //      Start with a space
        :                     //     Else (it's an 'o' instead)
         "")                  //      Start with an empty string
       +(""+(char)c).repeat(  //     And append the character itself
          .repeat(            //     Repeated the following amount of times:
           s.length()         //      The input-length
           -2*(~c&1)));})     //      Minus 2 if it's an "r", or 0 if it's an "o"
```
[Answer]
# [Brainfuck](https://en.wikipedia.org/wiki/Brainfuck), ~~276~~ ~~268~~ 206 bytes
Technically as the brainfuck only has 8 instructions, that means it needs only 3 bits per character instead of 8 (that also means we could encode brainfuck in base64 with exactly 2 instructions per character), but I'll play fair and say it's 268 bytes long.
It was a fun challenge, thanks!
**Edit**: now featuring the 3rd rule!
**Edit**: moving the line feed from the data pool to the display part of the code allowed me to get down to 268 bytes:
```
>>+<,[<++++++++++[>-----------<-]>-[>-<,>>+<<[-]>>>>[>]>++++[<++++++++>-]+>>++++++++++[<+++++++++++>-]<+>>++++[<++++++++>-]<[<]<<<]>[[-]>>>[>]>+++++++[<+++++>-]+>>+++++++[<+++++>-]>+++++++[<+++++>-]<[<]<<]+<,>>+<<]>>--[>>>+<<<-]>>[.>-[>>>>+<<<<->.<]>>.[-]++++++++++.>]
```
Here's a more readable version:
The data pool is made like so: [first character, placeholder value used to move the input character count, repeated character, last character]
```
>>+<,[//start of the loop
<++++++++++[>-----------<-]>-//"o"
[>-<,>>+<<[-]//if it's not a "o", skip one character and:
>>>>[>]//go to the data pool and search for the end
>++++[<++++++++>-]//put " " in memory
+>//put 1 in memory
>++++++++++[<+++++++++++>-]<+>//put a "o" in memory
>++++[<++++++++>-]<//put another " " in memory
[<]<<<//get back to the beginning of the data pool and get back to the program
]>[[-]//else (so if it's a "o"):
>>>[>]//go to the data pool and search for the end
>+++++++[<+++++>-]//put a "#" in memory
+>//put 1 in memory
>+++++++[<+++++>-]//put a "#" in memory
>+++++++[<+++++>-]<//put a "#" in memory
[<]<<//get back to the beginning of the data pool and get back to the program
]+<,>>+<<]//loop until the end of the input line and count the number of characters
>>//go to the number of characters variable
--//substract 2 to it because the first and last characters take one space each
[>>>+<<<-]//copy the value to the next place
>>[.>//start of the loop and display of the first character
-[>>>>+<<<<->.<]//display of the repeated character while copying the character count to the next line
>>.//display of the last character
[-]++++++++++.//display a line feed
>]//loop until the end of the data pool
```
It works on copy.sh/brainfuck with default settings
([link](https://copy.sh/brainfuck/?c=Pj4rPCxbPCsrKysrKysrKytbPi0tLS0tLS0tLS0tPC1dPi1bPi08LD4-Kzw8Wy1dPj4-Pls-XT4rKysrWzwrKysrKysrKz4tXSs-PisrKysrKysrKytbPCsrKysrKysrKysrPi1dPCs-PisrKytbPCsrKysrKysrPi1dPFs8XTw8PF0-W1stXT4-Pls-XT4rKysrKysrWzwrKysrKz4tXSs-PisrKysrKytbPCsrKysrPi1dPisrKysrKytbPCsrKysrPi1dPFs8XTw8XSs8LD4-Kzw8XT4-LS1bPj4-Kzw8PC1dPj5bLj4tWz4-Pj4rPDw8PC0-LjxdPj4uWy1dKysrKysrKysrKy4-XQ$$))
**Edit**: now down to only 206 Bytes thanks to @RezNesX
```
>>+<,[<-[>++<-------]>-[,[-]>->+>>[>]>+>+>-[<-->-------]>++++[<<<<++++++++>>>++++++++>-]<[<]<<<]>[[-]>>>[>]->+>->->--[<<<<-->>-->-->+++++++]<[<]<<]+>+<<,]>>--[>>>+<<<-]>>[.>-[>>>>+<<<.<-]>>.[-]++++++++++.>]
```
The code is quite similar but a lot of optimisation has been done in the creation of the data pool, very interesting.
[Answer]
# [Zsh](https://www.zsh.org/), 67 bytes
```
a=$#1
o()<<<${(l/a//=/)}
r()<<<\ ${(l/a>1?a-2:0//+/)}
eval ${1///;}
```
[Try it online!](https://tio.run/##qyrO@P8/0VZF2ZArX0PTxsZGpVojRz9RX99WX7OWqwgsFKMAEbQztE/UNbIy0NfXBkmmliXmAGUM9fX1rWv///@fX5Sanw8A "Zsh – Try It Online")
Explanation:
* `$1`: input
* `#`: length
* `a=`: assign to global variable `$a`
* `o()`: define a function called `o`:
	+ `${(l/a//=/)}`: left pad {nothing} with `=` signs to the width `$a` (i.e., print this many equals signs)
	+ `<<<`: print
* `r()`: define a function called `r`:
	+ `${(l///+/)}` left pad {nothing} with `+` signs,
	+ `a>1?a-2:0`: to the width of `$a - 2` if `$a > 1` else `0` (because otherwise, if `$a - 2` was negative, zsh would use its absolute value)
	+ `<<<\` : print with a space before
* `${1}`: input
* `///;`: replace all {empty string}s with `;` (effectively intersperses; `oreo` -> `;o;r;e;o`)
* `eval`: evaluate that as zsh code
	+ `o` and `r` call the functions defined above
	+ `e` is a non-existent command, so does nothing
	+ `;` separates the commands
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 19 bytes
```
Ｆθ≡ιo⟦⭆θ#⟧e«→Ｐ⁻Ｌθ²↙
```
[Try it online!](https://tio.run/##LY2xCsMgFEXn@BUPuyikS8d07RihtGPpIGJUCL5ETTKEfLu1tjwud7jn8JSVQaEccx4wAJs5xM0lZYE5DjtRMmqgSDu4B@cTez1TaSPkxOYW6InyN7/@KV2onTQCV826hzM2lakRy5jcVGXh/BJZr71Jtnxq4cIrUYUbbr7Xw9c5yJEzBo0lv0PM53X8AA "Charcoal – Try It Online") Link is to verbose version of code. Explanation:
```
Ｆθ
```
Loop through the characters of the input string.
```
≡ι
```
Switch on each character.
```
o⟦⭆θ#⟧
```
If it's an `o` then print the input string replaced with `#`s on its own line.
```
e«→Ｐ⁻Ｌθ²↙
```
If it's an `e` then move right, print a line of `-`s that's two less than the length of the input string, then move down and left.
[Answer]
# [C# (Visual C# Interactive Compiler)](http://www.mono-project.com/docs/about-mono/releases/5.0.0/#csc), 71 bytes
```
s=>s.Aggregate("",(a,c)=>a+(c>111?" ":"\n".PadLeft(s.Length+c/5-21,c)))
```
[Try it online!](https://tio.run/##bcqxDgIhEATQ3q8gWy25OwwmNioYGysKOxsbsi4cDSaA34@ndsZmJnkzVCeqqZ@fmQ61lZTj@C0rgjC9GlvVKcbC0TdGgBH9SNJYPyBZrfURBOzglkFd/N1xaFiV4xzbPNB6O2308pay71fXkhq7lBkDwgOk/KXC/3XxT7zH/gI "C# (Visual C# Interactive Compiler) – Try It Online")
Borrowed some ideas from on [Embodiment of Ignorance's answer](https://codegolf.stackexchange.com/a/178349/8340) for sure.
-6 bytes thanks to @ASCIIOnly!
The overall concept is to compute a string aggregate over the input characters following these rules:
* If an `r` is encountered, append a single space  character for indentation. We know the next character will be an `e`.
* If an `o` or an `e` is encountered, generate a string by repeating the current character a specific number of times and prepending it to a newline or some padding and a newline.
* The number of times to repeat is determined by length of input string and whether the current line is indented.
* The `PadLeft` function is used to generate the repeating character string.
The result is the concatenation of all of these strings.
[Answer]
# [C# (.NET Core)](https://www.microsoft.com/net/core/platform), 143 bytes
Without LINQ.
```
p=>{var q="";foreach(char c in p){if(c!='e'){for(var j=0;j<p.Length;j++)q+=(j<1|j>p.Length-2)&c>'q'?" ":c<'p'?"█":"░";q+="\n";}}return q;};
```
[Try it online!](https://tio.run/##NU89T8MwEN3zKw4PxFZoBIx1HAYkJpCQGFhYnMNNHKW2YzuVUMjOysIP5I8EVy26073Te/eJYYPWq3UK2rTw8hGi2vMMBxkCPHvbermfMwA3NYNGCFHGBAer3@FJakPZUQR4mAxWIfo04@oENTQgVifq@SA9jIIQvkt7JHYUu8QgaAOOzXpH8ULkKmdz0umxuBfXvK9c@ahMGzveFwUbC0H76uazr//pzS27xDof8zsCZItV7lL2@/NFtil@E546yJshfFm8ipM3MPKFr6f/yntrgh1U@ep1VLShJF12dsIYz5Zk6x8 "C# (.NET Core) – Try It Online")
[Answer]
# [Clojure](https://clojure.org/), 137 bytes
```
(fn[f](let[w(count f)r #(apply str(repeat % %2))](clojure.string/join"\n"(replace{\o(r w \#)\e(str \ (r(- w 2)\-) \ )}(remove #{\r}f)))))
```
I'm not using the nice characters in the printout in the golfed version since those are expensive. Returns a string to be printed.
[Try it online!](https://tio.run/##JYxRC4MwDIT/SqgIyYMb@HesD6WkQ@maktXJEH97V/GOPNzl43yUdVOumHVJJSbAiiFNYcbIZdrRy5YKBFLo0OUcf/ApisqZXYEe@pFoRn@PPNprSa/nKksyNpkLi87zYQUVdrAdWcYGgQVUHFo1kh2oRTob/JYvQ3dYPQNdqkaUpd1tEUME9Q8 "Clojure – Try It Online")
See below for explanation.
Pre-golfed:
```
; Backslashes indicate a character literal
(defn oreo [format-str]
  (let [width (count format-str)
        ; A helper function since Clojure doesn't have built-in string multiplication
        str-repeat #(apply str (repeat % %2))
        ; Define the layers
        cookie (str-repeat width \█)
        cream (str \ (str-repeat (- width 2) \░) \ )]
    (->> format-str ; Take the input string,
         (remove #{\r}) ; remove r for simplcity,
         (replace {\o cookie, \e cream}) ; replace the remaining letters with the layers,
         (clojure.string/join "\n")))) ; and join the layers together with newlines
```
[Answer]
# [Dart](https://www.dartlang.org/), ~~120~~ ~~106~~ 107 bytes
```
f(s)=>s.replaceAll('o',''.padRight(s.length,'#')+'\n').replaceAll('re',' '.padRight(s.length-1,'-')+' \n');
```
[Try it online!](https://tio.run/##bY1BCsMgEEX3PYXQxTjUCF2HFnqFrLuRZJIIVkXdlZ7dOmSVpszuzX//TyaVWmeZ8XbPOlF0ZqSHcxICKAAdzTTYZS0ya0d@KauCM@AFnh5wF0/U8uKP0F0VdKwIdvr6MtZLfJ@EiMn6Iuc2lSgAYr9jv6ANHMiRcVXgB1/YSj71Cw "Dart – Try It Online")
* +1 byte : Added trailing whitespace
]