[Question]
  [
It seems as of recent, there have been a lot a Jimmys falling to their death, as can be seen [here](https://codegolf.stackexchange.com/questions/187586/will-jimmy-fall-off-his-platform), [and here](https://codegolf.stackexchange.com/questions/187682/how-many-jimmys-can-fit) where you were asked to determine if Jimmy would fall. It is time we put a stop to this madness and try to save Jimmy.
Jimmy has three body parts `/`, `o`, and `\` arranged like this
```
/o\
```
Platforms are represented with `-`. Jimmy will fall off their platform iff they have two or more body parts that are not directly above a platform.
Some examples:
```
   /o\
- -------
```
Jimmy will balance since all their body parts are above a `-`.
```
   /o\
    ------   ---
```
Jimmy will balanced since two body parts are above `-`s.
```
 /o\
-- ----  --
```
Jimmy will balance even though they are split between two platforms
```
  /o\
   -
```
Jimmy will not balanced since two body parts are not above a platform.
---
Since my platform supply is running low, I only have platforms with a length of 5, and it is important we use as few as possible.
Your task is to take an input of Jimmys and output a string of platforms which will save all of the Jimmys in the input. Your output must use as few platforms as possible, but each platform must be 5 `-`'s wide.
Note that the rule of the platform being 5 `-` wide, means that each platform must have a space between them. `----------` is not valid in the output since it will be considered a platform of length 10 and not two platforms of length 5.
### Test Case's
```
/o\  /o\/o\    // input
----- -----    // output
```
```
/o\           /o\
-----       -----
```
```
/o\           /o\      // same input as above
-----          -----   // this is also valid output
```
```
    /o\ /o\
     -----
```
Standard rules apply.
This is code-golf, may the shortest answer win!
  
[Answer]
# [Python 2](https://docs.python.org/2/), ~~70~~ 67 bytes
```
lambda s:S('/',' ',S("\S.{5}","----- ",s+' '*5))
import re;S=re.sub
```
[Try it online!](https://tio.run/##PYlBCsMgFET3nuLjRm1tAoVsEnIKl7WLhEYqNCr6uyilZ7cVqgMzzLwJL7x7d85m1vmx7OttgTQqznomGTCpONWqew8fKumpCKhMx99zGIQgdg8@IsRtUnPcuvRcs/EREKyDiyZAe681QMliKhtqaryOSq4jgRCtQ8BaDEfx7yR/AQ "Python 2 – Try It Online")
*-3 bytes thanks to Kevin Cruijssen & Neil*
Not the prettiest, not sure how to better handle those leftover slashes...
Unfortunately, we can't replace both ends of each platform with spaces using a single `re.sub` call, because in the case of 2 platforms being one space apart, the gap between them can't be matched more than once. A lookahead/lookbehind assertion won't help, because anything matched within those assertions doesn't get replaced.
Using a single `re.sub` reference:
# [Python 3.8 (pre-release)](https://docs.python.org/3.8/), 78 bytes
```
lambda s:[s:=re.sub(".[^/ -].{5}"," ----- ",s+"  ",1)for c in s][-1]
import re
```
[Try it online!](https://tio.run/##PYlBCoMwFET3OcXwV0qNIqVQBE@SpKCtoUI1IUkXpfTsqVkkA//PzBv7CU@zn6/WRT3K@Jq2@THBD8IPo1ta/54rasWtA1ft9/KjhsCTQI0/EQ7ra20c7lh3eCV4r9i6WeMC3BLTEtIiJAN1Rkog/XTUFFRUeC6ZqIHBunUPVahz0kcupWbxDw "Python 3.8 (pre-release) – Try It Online")
[Answer]
# JavaScript (ES6), ~~56 55~~ 54 bytes
```
s=>[...s+1e4].map(c=>(s--?s:s=c>{}&&5)?'-':' ').join``
```
[Try it online!](https://tio.run/##VYvBCsIwEETv/Yo9dRNKIoJeCkk/xAgNMZWWmhQ3eBG/PTZQRQdmh3nLTPZhyd3HJYkQLz4PKpPSJyklNXt/OMubXZhTmpEQHbWknH6@6vrIOxTYIiCXUxxD3@fkKYECAqXBxUBx9nKOV0bQAJqAawyM@NZ4VZUBw100BqDc4pX/4q/@fh@w0fwG "JavaScript (Node.js) – Try It Online")
Or [47 bytes](https://tio.run/##VcvBCsIwDAbg@54ip6VltCLoZdDuQaywUjvZmO0wxYv47HWFKRrIH/h@MtmHJXcflyRCvPg8qExKn6SU1Oz94SxvdmFOaUZCdNSScvr5qusj71Bgi4A8J08JFBAoDS4GirOXc7wyggbQBFzPwIjLKY6h7zfkVVX@GO6iMQAly67@y9/56z6waX4D) if returning an array of characters is acceptable.
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), ~~17~~ 15 bytes
```
Ｗ‹ⅈＬθ«×⁵№o\§θⅈ→
```
[Try it online!](https://tio.run/##S85ILErOT8z5/788IzMnVUHDJ7W4WCNCQ1NHwSc1L70kQ6NQU1NToZqLM6AoM69EIyQzN7VYw1RHwTm/FMhVyo@JUdJRcCzxzEtJrdAo1FEAagUCay5O3/yyVA2roMz0jBIgt/b/f/38GAUFIAFEXP91y3IA "Charcoal – Try It Online") Link is to verbose version of code. Explanation:
```
Ｗ‹ⅈＬθ«
```
Repeat while the cursor position is less than the length of the input.
```
×⁵№o\§θⅈ
```
If the character at that position in the input is an `o` or a `\` then print 5 `-`s.
```
→
```
Move to the next character, thus guaranteeing at least one space between platforms.
Previous 17-byte solution is IMHO more "Charcoal-y".
```
θ⸿Ｆθ«×⁵¬№ /⊟ＫＤ²↑→
```
[Try it online!](https://tio.run/##S85ILErOT8z5/z@gKDOvRKNQ05oLwlKKKVICctLyixSAogrVXJwQ8ZDM3NRiDVMdBb/8Eg3n/FKQUgV9JR2FgPwCjYDU1GyXzKLU5JLM/DwNIx0Fq9ACTRCw5uL0zS9L1bAKykzPKAFya///18@PUVAAEkDE9V@3LAcA "Charcoal – Try It Online") Link is to verbose version of code. Output includes input, thus demonstrating correctness of solution. Explanation:
```
θ⸿
```
Print the input and move to the start of the next line.
```
Ｆθ«
```
Loop over every character of the input to ensure that no Jimmy gets missed.
```
×⁵¬№ /⊟ＫＤ²↑
```
Look at the character above the cursor. If there is none, or if it is space or `/`, then do nothing, otherwise print 5 `-`s.
```
→
```
Move to the next character, thus guaranteeing at least one space between platforms.
[Answer]
# [Python 3](https://docs.python.org/3/), ~~158~~ ~~164~~ 160 bytes
```
a=input();r=""
for i,c in enumerate(a):
 try:r[i]
 except:
  if c in"/o":
   r+=(a[i+5<len(a)and i+5or len(a)-1]=="o"and" "or"")+"----- "
  else:r+=" "
print(r)
```
[Try it online!](https://tio.run/##PVDLbsMgELzzFaPtBeQ8VEW9uPU/9NBbGkXEXsdUDlhA1OTr3cVNuzxnYBdmpnsegt/NeeBjGzpGAyKabeP8dM3avMaGSPUhwq1aOA/21wtHm1lbUyvkeK/j3h0U@NbylIWC61Gu0jZQgYhVo@3eVS9vI3tJs76DIKn5i9fPh6ahQMITKEQiU9G6BEjyeUxcSw05U1N0PutoZvmkUk94j6HllJw/o/x@hRyQhvAN0YPMKaO1iZNSfONWU8c9er1IMzWhEq2br@C8Hp3nAqUVrQsUsX@ubNI0ulzYpD/ilY1Z4TyGkx2TNkYt/hxLQrT@zHpXnJGHRns5dbbGw0uj5m34BGSSrpb9fxTmsZbxAw)
This is my first code golf answer, and I'm happy it's on a Jimmy question!
Explanation:
* `a=input();r=""`: Take in input and initialize a new string `r`.
* `for i,c in enumerate(a):`: Enumerate over the input.
* `try:r[i] ... except:`: See if `r[i]` exists - if not, process the `except` block.
* `if c in"/o":`: Check if the current character is in Jimmy's first two body parts.
* `r+=(a[i+5<len(a)and i+5or len(a)-1]=="o"and" "or"")+"----- "`: If so, add a new segment. Add a space before our new segment if another Jimmy head is present in five characters.
* `else:r+=" "`: Otherwise, just add a space.
* `print(r)`: Print our final result.
[Answer]
# [Retina](https://github.com/m-ender/retina/wiki/The-Language), ~~23~~ 21 bytes
```
/
 
$
5* 
\S.{5}
5*- 
```
-2 bytes thanks to *@Neil*.
Contains a single trailing space on the second, fourth, and sixth lines.
Port of [*@negativeSeven*'s Python 2 answer](https://codegolf.stackexchange.com/a/187735/52210), so make sure to upvote him!
[Try it online.](https://tio.run/##K0otycxLNPyvquGe8F@fS4FLhctUS4ErJliv2rQWyNRV@P9fPz9GQQFIABEXmA0HIBEoDcIA)
**Explanation:**
Replace all `"/"` with a `" "`:
```
/
 
```
Append 5 trailing spaces:
```
$
5* 
```
Replace all substrings of size six that do not start with a space by `"----- "`:
```
\S.{5}
5*- 
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt), ~~23~~ 22 bytes
A port of Arnauld's JS solution that I'm just too exhausted to fully test. If it's invalid can a Diamond please delete?
```
+L² £=U´?U:X>M©5)?'-:S
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=K0yyIKM9VbQ/VTpYPk2pNSk/Jy06Uw&input=Ii9vXCAgICAgICAgICAgL29cIg)
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 35 bytes
```
;3x5¤;0;ṛṫ6ɗ
;⁶x5¤e€⁾o\œṡ1ç/$ÐLị⁾- 
```
[Try it online!](https://tio.run/##y0rNyan8/9/auML00BJrA@uHO2c/3Lna7OR0LutHjdtAgqmPmtY8atyXH3N08sOdCw0PL9dXOTzB5@HubqCgrsL////182MUEADEAwA)
A monadic link that takes the input as a string and returns a Jelly string with the platforms. 
Takes inspiration from [@negativeseven’s answer](https://codegolf.stackexchange.com/a/187735/42248).
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~25~~ 24 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
ð5×«'/ð:DŒ6ùʒнðÊ}'-5×ð«:
```
Port of [*@negativeSeven*'s Python 2 answer](https://codegolf.stackexchange.com/a/187735/52210), so make sure to upvote him!
[Try it online](https://tio.run/##yy9OTMpM/f//8AbTw9MPrVbXP7zByuXoJLPDO09NurD38IbDXbXqukCpwxsOrbb6/18/P0ZBAUgAEQA) or [verify all test cases](https://tio.run/##yy9OTMpM/V9TpuSZV1BaYqWgoGRfqcMFpPxLS8ACQP7/wxtMD08/tFpd//AGK5ejk8wO7zw16cLewxsOd9Wq6wKlDm84tNrqv86hbfb/9fNjFBSABBBxgdlwABKB0iAMAA).
**Explanation:**
```
ð5×«                      # Append 5 trailing spaces to the (implicit) input-string
    '/ð:                 '# Replace all "/" with a space
        D                 # Duplicate the string
         Œ                # Get all substrings of this
          6ù              # Only leave those of length 6
            ʒ   }         # Filter it further by:
             нðÊ          #  Only keep those which do NOT start with a space
                 '-5×ð«  '# Push a string of 5 "-" appended with a space: "----- "
                       :  # Replace in the initially duplicated string all substrings 
                          # remaining in the list with this "---- "
```
]