[Question]
  [
# Challenge
Given a positive-length string \$S\$, a divisor of \$S\$ is another (not necessarily distinct) string for which there exists a number \$a\$ such that when we repeat the divisor \$a\$ times, we get the string \$S\$.
For example, the string `abcd` is a divisor of the string `abcdabcd` with \$a=2\$.
Your challenge is, given a positive-length string \$S\$, output all of \$S\$'s divisors.
For example, the string `aaaa` has three divisors: `a`, `aa`, and `aaaa`.
# Input/Output
Input/output can be taken in any reasonable format for taking a string and returning the set of divisors of that string.
The input string will only has lowercase characters, and it contains no whitespace or special characters.
The output list should not contains any duplicates. The strings can appear in any order.
Testcase:
```
Input -> Output
abcdabcd -> abcd, abcdabcd
aaa -> a, aaa
aaaaaaaa -> a, aa, aaaa, aaaaaaaa
abcdef -> abcdef 
```
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so shortest answer (in bytes) wins!
  
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 3 bytes
```
ġ=h
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/pfXa6koGunoFRu/6htw6OmpofbFjzc1Vn7cOuE/0cW2mb8/x@tlJiUnALCSjoKSomJiVAKDMBsoFRqmlIsAA "Brachylog – Try It Online")
[Generator.](https://codegolf.meta.stackexchange.com/questions/2447/default-for-code-golf-input-output-methods/10753#10753)
```
ġ      Split the input into (roughly) equal slices.
  h    Output one of them
 =     if they're all equal.
```
[Answer]
# [Python](https://www.python.org), 53 bytes
```
lambda s,t="":[t for c in s if~-any(s.split(t:=t+c))]
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72soLIkIz9vweI025ilpSVpuhY3TXMSc5NSEhWKdUpslZSsoksU0vKLFJIVMvMUihUy0-p0E_MqNYr1igtyMks0SqxsS7STNTVjoZqDC4oy80o00jSUEoFASVOTCyGQlJwCwlgFUzFEUyEEUBxi9IIFEBoA)
[Answer]
# Regex (ECMAScript 2018 or better), 17 bytes
```
(?<=(.*))(?=\1*$)
```
[Try it online!](https://tio.run/##bU69TsMwEN77FKmE5LsmtZq1wWRi6ApjW6kmuQQjxwlnh1apuvIAPCIvEtKyMHDSJ52@u@/nTX9oX7DpwtK1JY1erTJWT1Q/njp4DmxcLVkfDyPk9wrkAhFytUsXdzgepLemIEiTZYqJqAVmTO@9YQLBpEtrHAmUxbQH2rhAXOnp/Wxc14d1x21B3ksfSuMuKFsH4qZIrHo4/7m2fZBHNoEAfC52TqyFwNjGIvr@/IqmUK/SrGoZhqk6NIolnagAizhXyvXWZoNK8Tz733LIRRL9WjbbdI@ZqWDebFd7acnV4RVZWu3DxpV0iuPLBUf9UpRXzLTWV9xmdmWo@gE "JavaScript (Node.js) – Try It Online") - ECMAScript 2018  
[Try it online!](https://tio.run/##LY5BasMwFET3PsVgApKCIyK6sypygpwgycKt5VSgyuJLgcQHyAFyxF7Etdx@mMU8mMePj/w1hrfZfceRMtIjNWSv9q5Bhuq6nvnh3XC5FYIfzFltN2Je6Em1O3XRmMy@GkaChwtlK1PuXWgrLMTAS0qZXOTsHJhYoBswtYjkQualT0bp/@obG3rD8PN8gQmNtJiB4j4W9/qTHFzoXbbEqYEX7d@SNWDFnGB9smBsNR3llcZbTFyc9hehk1Fz9/HZl1Rd15WsVxVih18 "Python 3 – Try It Online") - Python (`import [regex](https://bitbucket.org/mrabarnett/mrab-regex/src/hg/)`)  
[Try it online!](https://tio.run/##dY1BasMwEEX3OYUQA9aExMTbKCKBrHOCNBTVGccCWTKSg0tcb3uAHjEXceVS6Kof/ubP/Pdb31OINVk7QVDnQDd6v2y3jnpxyCax3ymRLxHFXr0US8ApO6z40TetsXTlKOGhNrLygXRZC7DMOAbGtfcOB2gUhPyku7KmmG4oTSXggUMfTEfr2sduTPVCQkyMv5CtnU/z1jhiPCGfn1@MS2g@fmeG/17FzI84ZCuWjQlaIAh4zW/B39t4Li7Ix3HSb@V19kJrPftHizmh6hs "PowerShell – Try It Online") - .NET  
[Try it on regex101!](https://regex101.com/r/QsA4DK/1) - ECMAScript 2018 or .NET
Returns its output as the list of matches' `\1` captures.
Ports:  
[Try it online!](https://tio.run/##bVLBbtswDL3nKzhjRSU3VdGz5hXYsJ26YViO6wrItpwolSVPopssga/7gH3ifiSjHHddgRgWJD1Sj3wk1@pRXa7rh4NpOx8Q1nQXxotcwv9Ij8aexIJe6u1JS8SgVSvee2t1hT5EOev60poKKqtihE/KONjDhEVUSNujNzW0ZGELDMYtQYVl/PadA66C30T4sK10h8bTyxnAR2M1NIXTm/HIMlH5WguyZ1y@65tGB11/1arWAcrR7SXInl5O14ZzOcWNc5SbVeJnLBYl6VT1rXGacf6qcL213DQsCv2jVzay7CrP84zz/UvXIwNjeJJgTwz4j4EIroihJL8HGS@K8zt3nnaUwxEbvihEHRyEYjqR2rZLASKXVI3Se6uVg13REKOWsKiUcyTduK5HKCCpnTC2@BlRt8I4LmHSObqJlYqf9RYpzbHEAFNBLOVOHEcnRx6TROojViuK0pI1iPZ4Y8mdjCRxx6dYnh5ugkHNkjYudwWGPqX5bO4oFDYsO4vw59dvOIvZfAw8n7IQa0@jQSD9LZU09hYj4xS1Y224fJtlF7SLZfB9x64551SicfzY8xgK9LcmJoHU7WEYZql3B3bzpmD3Iuec3RR31/lrfkgdOaiyqtOaKaXSGr9ZQnTzFw "Java (JDK) – Try It Online") - Java, **18 bytes**: `(?<=(^.*))(?=\1*$)`  
[Try it online!](https://tio.run/##JYtNCsIwFIT3niLIw7xIaa3gxjQtBd26cimGWKstpD@kgmitSw/gEb1ITXVgFt/wTZ0aveiLGwHDSaurRGkCHrcoglW8jcOOnCqD0IgZD0LO2iSripqDFiCt1UwmtcnLy3hXjrmVfP5DAtql5PN6Uw53@7xmuU7Rnp4eGO/M2r@FCPeIOoQuKaHMAZ8Nut91Uq43Kyl7jAS6U8ZcxCgQlvY7fwoPjOZ2Y6zv1SE5Dh0ppYb@MhqW9PQF "Perl 5 – Try It Online") - Perl, **31 bytes**: `(?=(.*)).((?<=(?=^\1*$|(?2)).))`  
[Try it online!](https://tio.run/##fVFBbtswELz7FRuBCLmGLFs5hiF0qVsEKJJCzS1KCVqlLNWULJBMDklzzQP6xH7EXdnooTmUwBLc2eHscDm24@GqGNsRmAcFyTKBDEZvt9rb0ZnaCr7M5oXWrXFR1/t@7Jz1lahQVuUy8BQ4RUOg3tqJMEQ7xCC0/nj9ea01ppAjSZKwnHVDp4ONIhlrb7ONqXfR06Zd13cxSSFZ5AlK@Jfmbf3oQ7cf/k/7cSqtqDJr9l6wTq0kc6ohW0F8vftwfYMSX6BrBHP3IXpnBzrhIn9QKqmGBIkcHjdUIThdpYuclID4IM4E26njUHoT61Yb5wTzKdFYj4jA7KnqTIjaek/t8UypL@X6k7651euyvC1PWmQLbd3up4YSyGMuYcqBuYzD77dfnNBnck5seoU1dStYf58/gAnAnhBejmzBnotp9JccOGbs6Xgpl69//bIdnJ@TLTyJc1hPpi6BZ@986j5sBcrXd/9L0EEUSmRzxEyI4kpR9q3K5@ynKC4IQzwczKb@PsXMGDPFcc0mxDZ/AA "PHP – Try It Online") - PCRE2, **31 bytes** - same as above  
[Try it on regex101!](https://regex101.com/r/QsA4DK/2) - PCRE2  
[Try it online!](https://tio.run/##nVJLbtswFNzrFC8CEZKGPlaXlllt6hQGiqRQuotTgqZpSzUlC6QcFHG87QF6xF7EfbKRRbPoIgQokDPDeUPqLZWvTvObewHOqBXEbgWUgptOqXzXoMG06KoOiAMBYRpCAp0zG@lMZ5U2jKbJqJCyUraXetd0tTVuwRY8X5SppxEWj2CNoNyYQdD2pu09k/Jm/mUmJY8g42iJxnlQt7X0pmdhp51Jlkpve4cfaeum7sMIwjgLeQ7/ypzRe@frXft/2Y8LNUYmWO8cI7UY58SKNcby7P7bp/ktz/kB6jUj9sH3zpoWVzzOHoUIF23IUez3S2QQjsZRnKEToB7YFSNbcX6URvW6kspaRlyEMtJwzoGYC2uV76VxDsvzKyG@lrPP8vZOzsryrrx4YSxudLUbCuaAGbMchj0Qm1D48@s3RfQZk6Mab2GUrhhpHrJHUB7IE4fDWc3IczE8/YQC5Ql5Oh/K8uNrXrKF62uMxS/mFGZDqAnQ5E1O2fgN4/nxzf9F6MQKwZIR5wljxVTgLnj5vshG5IUVHxDl/PS@fgvOkeIWQnJwk0mcHcOPercyCTZhbn4aDeneu3RZt@nQlq/USS31apiBUmqY5xEMiFn/BQ "Bash – Try It Online") - PCRE, **33 bytes**: `(?=(.*)).((?<=(?=‍¶|^\1*$|(?2)).))`  
[Try it on regex101!](https://regex101.com/r/QsA4DK/3) - PCRE1
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~6~~ 5 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
ηʒKõQ
```
[Try it online](https://tio.run/##yy9OTMpM/f//3PZTk7wPbw38/z8xKTkFhAE) or [verify all test cases](https://tio.run/##yy9OTMpM/V9Waa@k8KhtkoKSfeWhlf/PbT816dC6Yu/DWwP/1@r8j1ZKTEpOAWElHaXExEQICQYgJlA8NU0pFgA).
**Explanation:**
```
η      # Get all prefixes of the (implicit) input-string
 ʒ     # Filter it by:
  K    #  Remove all occurrences of the prefix-string from the (implicit) input
   õQ  #  Check if what remains is an empty string
       # (after which the filtered list is output implicitly as result)
```
[Answer]
# [Factor](https://factorcode.org) + `grouping.extras`, ~~73~~ ~~70~~ ~~57~~ 48 bytes
```
[ dup head-clump [ ""replace ""= ] with filter ]
```
[Attempt This Online!](https://ato.pxeger.com/run?1=JYsxCsJAFET7nGKwT7AUxVpsbMRKLL6bv3FxTTY_f4kinsQmTbxTbmM0A495DMz7Y8loJd1gD_vtbrNE3aLhOnJpuMGVpWSPJnin6soCQVj1EcSVikKqGMYx47sKNVglSd0-QWeT_wAR_fjnv7LFq49q08UwPyKPARemPDU-3gKOmM2EgyfDo61xQuv0Auu8suA0_fobBWSTd93UXw)
-13 bytes and then -9 more by porting @KevinCruijssen's [05AB1E answer](https://codegolf.stackexchange.com/a/250966/97916) (and then improved version)!
[Answer]
# [Curry (PAKCS)](https://www.informatik.uni-kiel.de/%7Epakcs/), 26 bytes
```
f(g a)=a
g a|a>""=a++g a?a
```
[Try it online!](https://tio.run/##Sy4tKqrULUjMTi7@/z9NI10hUdM2kQtI1STaKSnZJmprA9n2if9zEzPzFGwV0hSUEqFA6T8A "Curry (PAKCS) – Try It Online")
[Answer]
# [Haskell](https://www.haskell.org/), 42 bytes
```
f s|p<-scanr(:)""s=[t|t<-p,a<-p,(a*>t)==s]
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/P02huKbARrc4OTGvSMNKU0mp2Da6pKbERrdAJxFEaCRq2ZVo2toWx/7PTczMs01PLfHJzEu1s7MtKMrMK9FLs7MDif9PTEpOAWGuxMREEAYDLpBIahoA "Haskell – Try It Online")
`scanr(:)""s` lists the suffixes of the input `s`. For each suffix `t`, we look for a suffix `a` where repeating `t` once for each character of `a` (`a*>t`) gives the original string `s`.
[Answer]
# [J](http://jsoftware.com/), 19 bytes
```
<\#~<=<\$~&.>#+#\|#
```
[Try it online!](https://tio.run/##y/pvqWhlGGumaGWprs6lpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/bWKU62xsbWJU6tT07JS1lWNqlP9rcvk56SlAZJRVgOI2MWARXQflGI3Yaj2l6rpo5TpDW2WHOj0HDZsYTc1YrtTkjHyFNAX1xKTkFBBWR4gkJqJwwEAdRUNqmvp/AA "J – Try It Online")
* `<\$~` Cyclically extend each prefix to the following length:
	+ `#+#\|#` Length of input `#` + the remainder when we divide that prefix's length into the input's length `#\|#`. This ensures non-divisible prefixes won't match.
* `<=` Which of the extended prefixes matches the input?
* `<\#~` Filter all prefixes using that mask.
[Answer]
# [K (ngn/k)](https://codeberg.org/ngn/k), 26 bytes
```
{((#(,x)^,\(#x)#,:)')_,\x}
```
[Try it online!](https://ngn.codeberg.page/k#eJxLs6rW0FDW0KnQjNOJ0VCu0FTWsdJU14zXiamo5eJKU1BKTAJBJTATCGAMCJ2UnALCcE5qmhIXAG3CFcU=)
I guess this is somewhat a new strategy. For each prefix, tests if the original input appears in the list of 1..(length of input) repetitions of the prefix.
```
{((#(,x)^,\(#x)#,:)')_,\x}  x: input string of length n
                      ,\x   prefixes
 ((               )')_      remove the items that give nonzero:
         ,\(#x)#,:            repeat the prefix 1..n times
    (,x)^                     set minus from the singleton list of x
   #                          is x still there?
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~8~~ 6 bytes
```
sJEƇḢ€
```
[Try it online!](https://tio.run/##y0rNyan8/7/Yy/VY@8Mdix41rfl/uN1bM/L/f6XEpOQUEFbSUVBKTEyEUmAAZgOlUtOUAA "Jelly – Try It Online")
Port of my Brachylog solution.
```
s         Slice the input into chunks of
 J        every length.
  EƇ      Keep only partitions with all equal elements,
    Ḣ€    and return the first element of each remaining partition.
```
[Answer]
# [K (ngn/k)](https://codeberg.org/ngn/k), 19 bytes
```
{(x{#,/y\x}/:)_,\x}
```
[Try it online!](https://ngn.codeberg.page/k#eJxLs6rWqKhW1tGvjKmo1bfSjNcB0lxcaQpKiUnJKSCsBOYkJsJoMFCCqUhNUwIArVUT2w==)
`,\x` get all prefixes of the input  
`... _` discard a prefix if:  
  `y\x` split the input by this prefix  
  `,/` concatenate parts into a single string  
  `#` length of this string is non-zero.
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~53~~ 52 bytes
```
->s{(1..k=s.size).map{|x|w=s[0,x];w*k==s*x ?w:s}|[]}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf1664WsNQTy/btlivOLMqVVMvN7Gguqaipty2ONpApyLWulwr29a2WKtCwb7cqri2Jjq29n@BQlq0UmJSMhApxXJBeGCgFPsfAA "Ruby – Try It Online")
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), ~~8~~ 6 bytes
```
øṖ~≈vh
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyJBUCIsIiIsIsO44bmWfuKJiHZoIiwiIiwiYWJjZGFiY2RcbmFhYVxuYWFhYWFhYWEiXQ==)
Port of Unrelated String's Jelly answer.
Porting Kevin Cruijssen's 05AB1E answer would be 6 bytes as well:
# [Vyxal](https://github.com/Vyxal/Vyxal), 6 bytes
```
¦'?$o¬
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyJBUCIsIiIsIsKmJz8kb8KsIiwiIiwiYWJjZGFiY2RcbmFhYVxuYWFhYWFhYWEiXQ==)
[Answer]
# [C# (Visual C# Interactive Compiler)](http://www.mono-project.com/docs/about-mono/releases/5.0.0/#csc), ~~68~~, 58 bytes
Iterate and replace every substring starting from index 0 and check if it equals an empty string
Credit to @Acer for the syntatic sugar
```
s=>s.Select((_,i)=>s[..++i]).Where(x=>s.Replace(x,"")=="")
```
[Try it online!](https://tio.run/##lY5BCsIwEEX3niJkldCYC2iyEQOKK110ISJpHOtATCVpwdvHtHoAO/AH/vDfZ1xauoTZDMGtUx8xtGK3DcMTom08/E5aE0NUTkoneQIPrmfsKpAXf5ayqvDCZf2ACOw9Ro7w8tYVIyjlSpWVV4tNF1LnQdYRezhgAPbtlvsOA6OCCmIYtY27jaKc878Za2fGp5nFlJfgPhH5Aw "C# (Visual C# Interactive Compiler) – Try It Online")
[Answer]
# [Nibbles](http://golfscript.com/nibbles/index.html), 5.5 bytes (11 nibbles)
```
|.,,$<$@~%@
```
```
|.,,$<$@~%@
   ,            # get the length of
    $           # the input string
  ,             # and make a range 1..length,
 .              # now, map over these values
     <$         # taking that number of characters
       @        # from the input string
                # (this gets the prefixes),
|               # now, filter these to keep only those that
        ~       # are falsy 
         %@     # when we use them to split the input string
                # (so, string-divisors yield the empty string)
```
[![enter image description here](https://i.stack.imgur.com/tXq1o.png)](https://i.stack.imgur.com/tXq1o.png)
[Answer]
# [Python](https://www.python.org), ~~65~~ 63 bytes
```
lambda s:[s[:i]for i in range(1,len(s)+1)if len(s)//i*s[:i]==s]
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72soLIkIz9vweI025ilpSVpuhY3HXMSc5NSEhWKraKLo60yY9PyixQyFTLzFIoS89JTNQx1clLzNIo1tQ01M9MUwCq0NCBC-vqZmra2xbFQg4ILijLzSjTSNJQSgUBJU5MLIZCUnALCWAVTMURTIQRQHGL0ggUQGgA)
A very unclever solution.
---
Saved -2 bytes from @ruancornelli.
[Answer]
# [Haskell](https://www.haskell.org/), 65 bytes
```
d s|r<-[1..length s]=[z|z<-(`take`s)<$>r,s`elem`[[1..n]>>z|n<-r]]
```
[Try it online!](https://tio.run/##FcqxCsMgEADQX3Ho0EIVuqtfkE4dRfAgRxKiR/Aui/jvNnnzW4F3zHmMWXGvVoePMRlpkVVxdKH1ZvUzCeyY@GUfvr45YcaSwj0pet86WV1jHAU2cgvKtBF67wocX3Wc8pM6kZkHXP4 "Haskell – Try It Online")
[Answer]
# [Knight](https://github.com/knight-lang/knight-lang), 32 bytes
```
;=x=yP Wx;I?y*x/LyLxOxN=xGxF-LxT
```
[Try it online!](https://tio.run/##lVhrc9s2Fv3eX0FzU4sQaVrOdLoT0bQmcZ2OZx05jd1mdiUlAkFIYkORCh@2XIn719N7wReol9N8yIjAwX3h3Af8J32gMYu8RXIShC7/xnwax8p/Am86S66iKIwUvkx44MaK@FplOeA9jWLe3JfOlKgPaZB48@dxd0nE6XzFwiBOopQlYaRRskpmXmzGYRoxbtMMdrzFx5mX8HhBGdeK/TlN2Ew7/aQNhqPhYBjDetYd6et/DT4Ng1FbGwbrF4S0T0m24PwL7EY8SaNAkYQPOqP1Okh9P8uFOQazO2Tl80ShtmPyJWeaBCdWIQKP2LZNe/ijK0Ns6bcZpw7YrlFQY/o8mCYzYtABG5EsCcFxL5jutCrLRDiU@/@@v7qzByMrD9Uf1E/5Kk5o4jFlgbegOWTlmFvhsSYQxQcagQ8di54LMYV@i@p67h@zxfqAjsxSluVNNEYKe1gm@ZpFaSDCHoWPSsAfc0ZkLnfS6Y71Pd4JIWa9Cbh@Ond4tAdXbgLuTRj6nAZ7gNVuVrDqBoIRUb8iXh66DZLF6QKlG0LUZ5cmFLiWOyop2eFM8V2f2@VJ8d0EbblRLsgw/tVH8woEVTywmgaMh5Pca8mN42PJeOBj/quMAgqvQlCEZIs/JdfrbLp/OyKD1yf/G7VPjbOK8vT4GC8YZWrqvYraSOam80XlzLh05oXIz4yMMz@Z1a4c1bYeH9PGtU1lnCLjjprALCfzIo1nGq4SK0@Vq/4f1x9u@@@u@vf2KisS5trlQbLBgefcH9CTvz6P8P/OyavPEILNAAihYGx2iE0egoBNzfiIo97EA1weohyHgQJzvWmAciRPBjVmVFEzN3gPCjP4IfRcpXOE91NabtUJKtdlbfx78CUIHwPFqyxTWg3TWuNmzIULpIyvFN3vpdfQ1bdDCgEt0oWSTVIVGzWnqOtKXCnP15zRqVQ6SAY1@CD8pAmfp/5BeLsJd70H2ct6C2@icQmlqHc0mZnAm4BJUk/B732XpF7SIAgTBVTBnSjOk/IXj0IVTA3df6i7VvgjfVYfiE/9UNK3CB8P66vFr9dHGj3vkO9yvt3@Du/5chEGSFKacGGQkoRQGwM@Bb49cAWM4xEY6e@pJOfyve2tNxcNVIP4Ne370BAP816q3hXx@0VJJTnnUUijhJQVBNvtRg6oCNaIeqgzCHmF88@EkoVzMJOLI6ZaBeMfnpKDg2tldKA5PhscpJBjU6nnqK0RgTkuHt6N2j0yPDs1XgpaYTSAWY5MJNCAw0o@xFAzH@4QrLawLbH1uqW28AepXaqHVix6YNXcC4BJrvI1DYFQPGBhisvc7SovVjQb72rpwv5mHhlnHbJedzZqVjEgHKpZ6MS4ABQKt0sPgmpdZsQXnELvkSvQM4yvRq2DjK9Q8qXCYtFd4RR1754C1qWZHfGvqRdxTZ3EKjFWOCKLLUfaYjPPdz8vopDxGFFvf@9f3l/f9u/q3vwWasCh1iyxJL9gmMwrMQNH6nTipqVZ1ZJ41euKrNPXJjnNGcNxnsb5GD9cmI/dc1bOxm45G09sYZFZmoLKjiZ76PTOg94dTBUaTdM5DhwvVq5@limgRJmgl9BRHWykFs8DOyGZdMcYCI0ZjsE3RgpYYhtjBYqzaf47oHNuO/lvUB3bbHt2FQc00zQrVFVZ8iquovbECwNN1SupVXgcpRw5xVGq26qhqLpj5jKqLq6rW7Xp1vmTs8T0YsFfA8albFKoUiI@9eKECxfJCkJ7hr2qfCBtvCU0tQ8mKfMUhjwHEnVJWeI/KdALFDajEXzBzOKHwRRqklUThI5sR9IIgak6l3y1RZLBC1RzpDwgcu2px6j8vWHtpIHaD5UHlAyFMvVdtFWocI@gVkpZhQEnRhUC9b1qaMS@KJ5kqmo49pt0MuGRSX0/ZBoM4G6IQaJaBxjRgYncAMo78KQkDhj@xWI6uPoIGce1M@jCYke85EzMrY8eJL46DFRCmM3M2PfghdgxlJN6si8rDSOZbNmH3LJG6574Ifj608tXP736@d8vX/3cFqsRDdxwjmGTz1@pBrUvMGS0Edoa0nrdQkiV6Hl4C6scubuBAb3SzFySOYnC@SUw4DJ0YdAs3k6kW5orX6fJCtzrBGc22cg3wkgqL13mS8XjUvwvb4/FdtWHms7tcVT9TRwqCqLJl95mFZewR5UC8dZqPoAayJsKiR7LhpTJJKN/QW5dVONbI9ilZXHihmliPkbQuEFgnufEoI2Y3TYF1VoLaepwKJ6H5Z8/gGq9PQoKRMco0x@wpLsTPMYu@cOYGNX0JNukA1mxnNQXhy238LIRhpMtJL4QdiHbW0js0LuQp1tI8S7YgfxxW2a4285PW0gxf@9AnlfIijTlEZwNqiPymYv9Z6b7zvT2n8Hiv/PMcXVGo2WGN/5i0yuOdRs5uH72GO0627lpScfyXWNXwGwJ1qgy@Lhdr0Gl9NBvpjQ1i5e6Y1f6nYbwj5XwFfZRq5G@FtlIvJ1kvs5FQPu3L@jOYLFt33@VDomg1XYbTuO5ZmAjkD7LWlalIwpZr1W1GbW7QoErVJSHnlHl2u625gpcZj0O@D2qw3xZVwSH6EyvTdJd7Mp16/h/S659zUc84CA642@WvbSf3isfl9Z176m9PL15ulneLvv28tfl25Ob5f23MbxFPWxc1jda/Pvhbw "JavaScript (Node.js) – Try It Online")
```
; = x (= y (PROMPT))                            # x = y = input()
: WHILE x                                       # while x != "":
    ; IF (? y (* x (/ (LENGTH y) (LENGTH x))))  #   if y == x * (len(y) / len(x)):
        : OUTPUT x                              #     print(x)
        : NULL                                  #   else: (do nothing)
    : = x (GET x 0 (- (LENGTH x) 1))            #   x = x[:-1]
```
[Answer]
# [Python 3.8](https://www.python.org), 56 bytes
*-7 bytes thanks to user `loopy walt`*
```
lambda s,d='':[d for c in s if len(s)//len(d:=d+c)*d==s]
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72soLIkIz9vweI025ilpSVpuhY37XMSc5NSEhWKrTRSrGzV1TXzi6JTFNLyixSSFTLzFIoVMtNAEinayZpaGjmpeRrFmvr6IDpFU9PWtjgWaowjSEcxSEe0emJScgoIq-soqCcmJkIpMACzgVKpaeqxVlwKCgVFmXklGmlAQzUhBi1YAKEB)
[Answer]
# [Ruby](https://www.ruby-lang.org/), 43 bytes
```
->s{(s+?␀+s).scan(/(?=(.+)␀\1*$)/).flatten}
```
[Try it online!](https://tio.run/##PYtLDoIwGIRZc4ofNDwECrhtKgcBFgVbJakNoSUGjFsP4BG9CFJMnGRmMTPfMDbTwsmSnNQjUFFhRSpEqqUySIOCBCgKrSo/7MM0RFxQrZl8LjPJMNyvnWAgyIVpZQN0HGbH9P2oFQYmzxhmkmMziDLJa0LcSrp4JUSZIZQc6@31Qx2B2K3XUwGet96z2iH@zl83gH7opAYRgwuf1xvcGHgp/uyaC23as7FNKTXeZJuG8S8 "Ruby – Try It Online")
This concatenates the string to itself with a NUL (ASCII 0) character between, in order to use a regex to find all matches' `\1` captures. Since Ruby does not have variable-length lookbehind and can't emulate it with recursion, this approach couldn't work on the unmodified string.
Since this does a manipulation on the input before working on it, thus departing from my idea of what a pure regex is, I'm posting this as a separate answer.
# [Ruby](https://www.ruby-lang.org/), ~~35~~ 34 bytes
```
->s{(s+?␀+s).scan /(?=(.+)␀\1*$)/}
```
[Try it online!](https://tio.run/##PYtLDoIwGIRZc4ofNDwECrhtKgcBFgVbJamE0BIDxq0H8IheBFtMnGRmMTPfODXzysmanOQjkFFhRTJEsqU9pEFBAhSFVpUf9mH6XBeSYbhfO8FAkAtT0gboOCyO6YdJSQysP2NYSI7NIMokrwlxq97FmhBlhlByrLfXD3UEYrdBzQV4nr5ntUP8na83gGHsegUiBhc@rze4MfBS/FmdK23as7FNKTXeZJuG8S8 "Ruby – Try It Online")
If it is acceptable to return the output as a list of one-element string lists, then this answer can be even shorter. This returns, for example, `[["abcdabcd"], ["abcd"]]` instead of `["abcdabcd", "abcd"]`.
# [Ruby](https://www.ruby-lang.org/), ~~50~~ 47 bytes
```
->s{(s+s).scan /(?=(.+)(?=.{#{s.size}}$)\1*$)/}
```
[Try it online!](https://tio.run/##PYtNCoMwFIT3nuL5gz9Vo3YbUg@iLqImrZCKGKWouO0BesRexCYt9MG8gZn5xrleDk6O@CI3X4YyQLKhPSR@TnwUBsrQZm8SyW5l@@4EZXZygmQ/VpJieNw6wUCQK5ukAdBxWE2dD/MkMbC@xbCSDOtCFHFWEWKVvYUVIYoUofhcfVc/1BSI3YdpycF11TytTOLZnuoAhrHrJxARWPB@vsCKgBfiz6p/0LpptQxKqdb3DJ0w/gE "Ruby – Try It Online")
This approach works even on strings containing NUL(s), as it uses the length of the string (rather than a delimiter) as a marker. As with the 35 byte solution above, it returns a list of one-element string lists.
[Answer]
# [Raku](http://raku.org/), 25 bytes
```
{~«m:ex/^(.+)$0*$/»[0]}
```
[Try it online!](https://tio.run/##K0gtyjH7n1upoJamYPu/uu7Q6lyr1Ar9OA09bU0VAy0V/UO7ow1ia/8XJ1YqKKnEK9jaKVSnKajE1yoppOUXKdgkJiWngLBCYmIiCIOBAkgkNc3uPwA "Perl 6 – Try It Online")
`m/^(.+)$0*$/` looks for patterns of letters which, repeated, comprise the entire string. The `:exhaustive` flag on the match operation (shortenable to `:ex`) looks for every possible match, not just one. Then `»[0]` extracts just the first submatch (ie, the divisor) from every match, and `~«` stringifies each of those match objects.
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 17 bytes
```
&!`(.+)$(?<=^\1+)
```
[Try it online!](https://tio.run/##K0otycxL/K@q4Z7wX00xQUNPW1NFw97GNi7GUFvz///EpOQUEOZKTEwEYTDgAomkpgEA "Retina 0.8.2 – Try It Online") Link includes test cases. Explanation:
```
&!`
```
List all overlapping matches.
```
(.+)$
```
Match any suffix...
```
(?<=^\1+)
```
... which can be repeated to recreate the original string.
[Answer]
# [Husk](https://github.com/barbuz/Husk), 7 bytes
```
fȯEC¹Lḣ
```
[Try it online!](https://tio.run/##yygtzv7/P@3EelfnQzt9Hu5Y/P///8Sk5BRkDAA "Husk – Try It Online")
```
      ḣ     # get the heads (prefixes) of the input
f           # filter these to keep only truthy by
 ȯ          # result of 3 functions:
   C¹       #  cut the input into pieces
     L      #  with the length of each prefix
  E         #  and check if they're all equal
```
**Alternative, also 7 bytes**
```
foE`x¹ḣ
```
[Try it online!](https://tio.run/##yygtzv7/Py3fNaHi0M6HOxb///8/MSk5BRkDAA "Husk – Try It Online")
```
foE`x¹ḣ
      ḣ     # get the heads (prefixes) of the input
f           # filter these to keep only truthy by
 o          # result of 2 functions:
   x        #  split on given substring
  `         #  (with reversed arguments)
    ¹       #  the input 
            #  (note that first element will always be empty list
            #  when splitting using a prefix)
  E         #  and check if they're all equal
            #  (which will only be the case if all are emty lists, 
            3  meaning that the input was a multiple of the substring)
```
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 15 bytes
```
ΦＥθ…θ⊕κ№Ｅθ×ι⊕μθ
```
[Try it online!](https://tio.run/##S85ILErOT8z5/z@gKDOvRMMtM6cktUjDN7FAo1BHwbkyOSfVOSMfzPHMSy5KzU3NK0lN0cjW1NQESueXArVA1YZk5qYWa2SiqssFqysEktb//ycmIeB/3bIcAA "Charcoal – Try It Online") Link is to verbose version of code. Explanation:
```
  θ             Input string
 Ｅ              Map over characters
    θ           Input string
   …            Truncated to length
      κ         Current index
     ⊕          Incremented
Φ               Filtered where
         θ      Input string
        Ｅ       Map over characters
           ι    Current prefix
          ×     Repeated by
             μ  Inner index
            ⊕   Incremented
       №        Contains
              θ Input string
                Implicitly print
```
[Answer]
# [sed](https://www.gnu.org/software/sed/) `-n`, ~~58~~ 46 bytes
```
s/^/\n/
:a
/^\(.*\)\n\1*$/P
s/\n\(.\)/\1\n/
ta
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m724ODVlWbSSbp5S7IKlpSVpuhY39Yr14_Rj8vS5rBK59ONiNPS0YjRj8mIMtVT0A7iKgTJAoRhN_RhDkJqSRIguqOYFexKTklNAmCsxMRGEwYALJJKaBlEDAA)
[Answer]
# Rust, ~~108~~ 106 bytes
-2 bytes thanks to alephalpha
```
|a:&str|(1..=a.len()).map(|k|a[..k].repeat(1)).filter(|z|z.repeat(a.len()/z.len())==a).collect::<Vec<_>>()
```
[Playground Link](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=0cfe163a5bcc88f1c5713a5a83a48b0a)
[Answer]
# Haskell + [hgl](https://gitlab.com/WheatWizard/haskell-golfing-library), 12 bytes
```
he<<fl lq<pt
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m708I7E4OzUnZ8FNxczcgvyiEoXC0sSczLTM1BSFgKLUnNKUVC6oRMDS0pI0XYt1abYZqTY2aTkKOYU2BSUQwe25iZl5tgVFKmlKiUkIqASRXbAAQgMA)
## Explanation
* `pt` gets all ways to partition the input into non-empty lists
* `fl lq` filters out all items with duplicates
* `he` takes the first value in each result
## Reflection
* A function that gives partitions satisfying a predicate would be immensely useful here. This could be `he<<pST lq`
* Similarly we should add a function that gives all partitions where the elements satisfy a predicate.
* A function that gives all permutations with equal size would not save any bytes here, but it would make this answer a lot faster to run and would probably be useful in the future.
* `ƥ`, `mP`, `ms` and `mS` all need flipped versions.
* A prefix and suffix filter would be useful. There are currently functions to get the longest suffix/prefix satisfying a predicate but not all.
* Shortcuts to check if a list has a particular length would be useful. There are already ones for checking if it is less than or greater than a value.
[Answer]
# [Arturo](https://arturo-lang.io), 56 bytes
```
$[s][select map 1..size s=>[take s]'y->""=replace s y""]
```
[Try it](http://arturo-lang.io/playground?XaVqot)
[Answer]
# [Zsh](https://www.zsh.org/), 47 bytes
```
for c (${(s..)1})s+=$c&&[[ $1 = ($s)# ]]&&<<<$s
```
[Try it online!](https://tio.run/##qyrO@F@cWpJfUKKQWlGSmpeSmpKek5/ElZJZpqGpAZRR0K34n5ZfpJCsoKFSrVGsp6dpWKtZrG2rkqymFh2toGKoYAuUKdZUVoiNVVOzsbFRKf6vyQXSr5CYlAxBEB4YwCRSUtPATKCZOdHGZrHRubGatagieYlAof8A "Zsh – Try It Online")
Fairly straightforward:
```
for c (${(s..)1})       # (s)split $1 on '' (into characters)
    s+=$c &&            # append character to $s
    [[ $1 = ($s)# ]] && # if $1 equals $s repeated
    <<< $s              # output $s
```
[Answer]
# [Perl](https://www.perl.org/) `-p`, 22 bytes
```
/^(.*)\1+$(??{say$1})/
```
[Try it online!](https://tio.run/##K0gtyjH9r1JsqxJvrZCckZ9boKBSbK1QUJSZV6KgFJOnUmwVk6dk/V8/TkNPSzPGUFtFw96@ujixUsWwVlP////EpOQUEOZKTEwEYTDgAomkpv3LLyjJzM8r/q/ra6pnYGjwX7cAAA "Perl 5 – Try It Online")
This uses a "postponed" regular subexpression embedded code block to accomplish the same thing as Raku's `ex`haustive verb (which is used in [Sean's answer](https://codegolf.stackexchange.com/a/250979/17216)), enumerating all possible matches, not just the ones (the one, in fact) that would be found normally.
Once a match of `^(.*)\1+$` that *would* be successful finishes, the embedded code block is triggered, and `say$1` prints the value of the `\1` capture group. Since it's of the "postponed" type, it then dynamically compiles the result of `say$1` (which is the boolean `1`) into the regex, causing the match to fail, since `1` can never occur after the end of a string. A literal `1` placed after the `$` would cause the match to fail and give up, due to Perl's regex optimization. But since it's *dynamically* compiled into the regex, the result of executing a piece of code, Perl doesn't *know* that it will be `1` every time, so it actually allows the regex to backtrack and try other possible matches.
The regex is intentionally set to not let `\1` match the entire input string, only strict substrings. `^(.*)\1*$` would be the version that would also match the entire string. But that is left out, because once the program finishes, Perl's `-p` flag causes `$_` to be printed. That way, all of the string's divisors, including itself, are outputted.
Embedded code capability is a rare thing in regex engines. As far as I know, the only ones that have it are Perl and Raku (embedded code blocks) and PCRE (callouts). It [appears that MATLAB](https://www.mathworks.com/help/matlab/ref/regexp.html) allows execution of MATLAB code inside a regex, but I have not tested that yet (and am not sure if GNU Octave, which uses PCRE, has that functionality, or if MATLAB even also uses PCRE).
Another thing to note is that inputs followed by a newline (rather than EOF) will have that newline included in the contents of `$_`, and this program doesn't use `chomp`. But that doesn't matter, since `$` matches both the true end of string, and the position immediately before a newline at the end of the string, if there is one. This is the case regardless of whether the `m`ultiline flag is enabled (which it is not, by default). This is a case where that behavior (as opposed to `\z`, which strictly matches the end of string) is helpful.
# [Perl](https://www.perl.org/) `-n`, 22 bytes
```
/^(.*)\1*$(??{say$1})/
```
[Try it online!](https://tio.run/##K0gtyjH9r1JsqxJvrZCckZ9boKBSbK1QUJSZV6KgFJOnUmwVk6dk/V8/TkNPSzPGUEtFw96@ujixUsWwVlP////EpOQUEOZKTEwEYTDgAomkpv3LLyjJzM8r/q/ra6pnYGjwXzcPAA "Perl 5 – Try It Online")
This is really the more logical version, printing the divisors in a consistent order. But I'm keeping the `-p` version up here, since `-p` is much more commonly used in answers, and as the way flags are treated (as distinct languages, in a certain abstract way) it lets it be in the same playing field as those `-p` answers. Not to mention that the workaround it uses is kind of fun.
]