[Question]
  [
Title misspelled on purpose. Read more to find out why.
Your task: given a delimited string or list including the characters `A,B,C,D`, output the indexes of all the adjacent equal characters. Output can be multiple strings/integers on multiple lines, a list/array, or a delimited string.
All output should be in a list or string, or multiple printed lines. Each printed line, if there are multiple, should only contain 1 string or number. Trailing whatevers are okay.
Standard methods of input/output. Standard loopholes apply.
For example, the input `'ABCDDCBA'` should output `3,4` or `4,5`, depending on whether it is 0- to 1- indexed, because those numbers are the indexes of `D` and the `D` next to it.
**Test cases:**
Test cases have input given as a single string, and output as a `,`-delimited string. Outputs are 0-indexed, add 1 to every outputted item to get it to be 1-indexed.
```
Input: 'ABCDCABCD'
Output: ''
Input: 'AABBCCDD'
Output: '0,1,2,3,4,5,6,7'
Input: 'ABCDDDCBA'
Output: '3,4,5'
Input: 'ABBCDD'
Output: '1,2,4,5'
```
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so shortest code wins!
  
[Answer]
# [Retina](https://github.com/m-ender/retina), ~~33~~ ~~29~~ 23 bytes
*Saved 6 bytes thanks to Martin Ender*
```
T`L`:`(.)\1+
:
$.`¶
T`L
```
Outputs a linefeed-separated list of indices.
[Try it online!](https://tio.run/nexus/retina#@x@S4JNglaChpxljqM1lxaWil3BoGxdQ8P9/RydnZ2cnFxdXAA "Retina – TIO Nexus")
**Explanation**
```
T`L`:`(.)\1+
```
Transliterate runs of the same character into colons, to mark positions where there are duplicate characters.
```
:
$.`¶
```
Then replace each colon with the length of the text before it, followed by a linefeed.
```
T`L
```
Finally, delete any remaining letters.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 7 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
JṁŒgḊÐf
```
1-based; returns a list of lists of the runs of indexes [as allowed](https://codegolf.stackexchange.com/questions/116113/wherre-are-the-adjacent-characters-in-the-title-3-4/116146#comment283578_116113) by the OP.
**[Try it online!](https://tio.run/nexus/jelly#@@/1cGfj0UnpD3d0HZ6Q9v//f3VHRycnZ2cXF3UA "Jelly – TIO Nexus")**
### How?
```
JṁŒgḊÐf - Main link: char-list s       e.g. 'DCCABBBACCCD' (which is a python interpreted input of ['D','C','C','A','B','B','B','A','C','C','C','D'])
J       - range(length(s))                  [1,2,3,4,5,6,7,8,9,10,11,12]
  Œg    - group-runs(s)                     [['D'],['C','C'],['A'],['B','B','B'],['A'],['C','C','C'],['D']]
 ṁ      - mould left like right             [[1],[2,3],[4],[5,6,7],[8],[9,10,11],[12]]
     Ðf - filter keep items that would be truthy (empty is not truthy) after applying:
    Ḋ   -     dequeue (x[1:])               [    [2,3],    [5,6,7],    [9,10,11]     ]        
```
[Answer]
# [Brain-Flak](https://github.com/DJMcMayhem/Brain-Flak), ~~57~~ 46 bytes
```
{({}[({})]<(([]<>)[()])>){(<{}{}{}>)}{}<>}<>
```
Includes +2 for `-ar`
Uses 0-based indexing.
[Try it online!](https://tio.run/nexus/brain-flak#@1@tUV0bDcSasTYaGtGxNnaa0RqasZp2mtUaNtW1IGinCSRs7IDo/39HRydnl/@6iUUA "Brain-Flak – TIO Nexus")
```
# While true
{
  # Subtract the second value on the stack from the first
  ({}[({})]
  # Push the height of this stack (the main stack) on the other stack
  <(([]<>)
  # Push the height of the main stack - 1
  [()])>
  # Push the difference that we calculated a second ago
  )
  # If they weren't the same character
  {
    # Pop the difference and the two stack heights
    (<{}{}{}>)
  # End if
  }
  # Pop the difference (or the 0 to get out of the if)
  {}
# Switch back to the main stack and end while
<>}
# Switch to the stack with the indexes and implicitly print
<>
```
[Answer]
# [MATL](https://github.com/lmendo/MATL), ~~8~~ 7 bytes
```
d~ftQvu
```
Output is 1-based.
[Try it online!](https://tio.run/nexus/matl#@59Sl1YSWFb6/7@6o5Ozi4uLs5OjOgA "MATL – TIO Nexus")
### Explanation with example
Consider input `'ABCDDDCBA'`.
```
d     % Implicitly input a string. Consecutive differences
      % STACK: [1  1  1  0  0 -1 -1 -1]
~     % Negate. Each character that equals the next gives true
      % STACK: [0 0 0 1 1 0 0 0]
f     % Find: (1-based) indices of true elements
      % STACK: [4 5]
tQ    % Duplicate, add 1 element-wise
      % STACK: [4 5], [5 6]
v     % Concatenate vertically
      % STACK: [4 5; 5 6]
u     % Unique (remove duplicates). This doesn't automatically sort, but the 
      % output will be sorted because the input, read in column-major order, is 
      % Implicitly display
      % STACK: [4; 5; 6]
```
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 19 bytes
```
l⟦k:?z{sĊtᵐ=∧Ċ∋h}ᶠd
```
[Try it online!](https://tio.run/nexus/brachylog2#ASwA0///bOKfpms6P3p7c8SKdOG1kD3iiKfEiuKIi2h94bagZP//IkFCQkNERCL/Wg "Brachylog – TIO Nexus")
### Explanation
Brachylog is usually terrible with indexes, which again shows here.
If `false.` is an acceptable output in cases where there are no adjacent characters, then this would be 1 byte less by replacing `ᶠd` by `ᵘ`.
```
l⟦k                      The list [0, …, length(Input) - 1]
   :?z                   Zip the Input with this list
      {         }ᶠd      Find with no duplicates:
            ∧Ċ∋h           The heads of each element of Ċ = [A, B] (i.e. the indexes)…
        Ċtᵐ=               …where the tails of both A and B are equal (i.e. the letters)…
       sĊ                  …and where Ċ = [A, B] is a substring of the Input
```
[Answer]
## Mathematica, 32 bytes
```
Union@@StringPosition[#,x_~~x_]&
```
Pure function which returns the 1-indexed positions of characters adjacent to an identical character.
## Explanation:
`StringPosition["string","sub"]` gives a list of the starting and ending character positions at which `"sub"` appears as a substring of `"string"`. `x_~~x_` is a `StringExpression` which matches two adjacent, identical characters. For example, `StringPosition["ABCDDDCBA",x_~~x_]` gives `{{4, 5}, {5, 6}}`. Applying `Union` joins the lists, sorts, and deletes duplicates.
[Answer]
# [Brain-Flak](https://github.com/DJMcMayhem/Brain-Flak), ~~69, 59~~, 56 bytes
```
{({}[({})]<(())>){((<{}{}>))}{}{([{}]([]<>))(<>)}{}}<>
```
[Try it online!](https://tio.run/nexus/brain-flak#DYixDcAwDMPekYZ@YARI4i8MD32hq@DbXQ8kQLagioFpALkowFSqRY6FUCUibRqjeWWre5/r7vfsft7vBw "Brain-Flak – TIO Nexus")
+2 bytes for the `-ar` flags which enables ASCII input and reverses the stack.
Uses 0-based indexing. Saved 10 bytes by [reducing my push-pop redundancy](https://codegolf.stackexchange.com/a/95404/31716). Saved another 4 bytes by switching from 1 to 0-based indexing.
This is pretty much the only string based challenge that brain-flak is good at. That's because brain-flak is great at comparing consecutive characters, even though it's horrendous at string processing in general. Here is readable version of the code with comments to explain how it works:
```
#While True
{
    #Determine if top two are equal
    ({}[({})]<(())>){((<{}{}>))}{}
    #If so
    {
        #Pop the one, and negate it's value (giving us -1)
        ([{}]
        #Push stack height over
        ([]<>)
        #Then push stack height plus the negated pop (-1)
        ) 
        #Push a zero back onto the main stack
        (<>)
    #Endwhile
    }
    #Pop the zero
    {}
#Endwhile
}
#Toggle back, implicitly display
<>
```
[Answer]
# Cubix, ~~37 32 31 29~~ 28 bytes
*Thanks to ETHProductions for pointing me in the direction of a three-byte saving*
```
$uO@(;Usoi?-!w>;.....S_o\;#O
```
Try it [here](https://ethproductions.github.io/cubix/?code=JHVPQCg7VXNvaT8tIXc+Oy4uLi4uU19vXDsjTw==&input=QUJDQ0Q=)! Note that the output indices are 1-based and not in ascending order.
### Expanded:
```
      $ u O
      @ ) ;
      U s o
i ? - ! w > ; . . . . .
S _ o \ ; # O . . . . .
. . . . . . . . . . . .
      . . .
      . . .
      . . .
```
# Explanation
This works by reading the input character by character. To compare two characters, we simply subtract the their character codes, and if the result is 0, we print the current length of the stack, a space, the current length of the stack - 1 and another space. Then we clean up the stack a bit, and we start with the read loop again. If the end of the input string is reached, the program stops.
[Answer]
# [Octave](https://www.gnu.org/software/octave/), 35 bytes
```
@(s)unique([x=find(~diff(+s)),x+1])
```
[Try it online!](https://tio.run/nexus/octave#@@@gUaxZmpdZWJqqEV1hm5aZl6JRl5KZlqahXaypqVOhbRir@T9NwVYhMa/YmitNQ93RydnFGUSoa@oogPiOTk7Ozi5wLlDGxcXZyVFd8z8A "Octave – TIO Nexus")
Similar to my [MATL answer](https://codegolf.stackexchange.com/a/116123/36398). Here `unique` automatically sorts . The input to `diff` must be converted to `double`, which is done by the unary `+`.
[Answer]
## [C#](http://csharppad.com/gist/bb506264460c250ab6373c7781c4fb87), 115 bytes
---
**Golfed**
```
i=>{var o="";for(int x=1,l=i.Length;x<=l;x++)o+=(x<l&&i[x]==i[x-1])||(x>1&&i[x-1]==i[x-2])?(x-1)+" ":"";return o;};
```
---
**Ungolfed**
```
i => {
   var o = "";
   
   for( int x = 1, l = i.Length; x <= l; x++ )
      o += ( x < l && i[ x ] == i[ x - 1 ] ) || ( x > 1 && i[ x - 1 ] == i[ x - 2 ] )
         ? ( x - 1 ) + " "
         : "";
   
   return o;
};
```
---
**Ungolfed readable**
```
i => {
   // List of positions
   var o = "";
   
   // Cycle through the string
   for( int x = 1, l = i.Length; x <= l; x++ )
      // Check if 'x' is below the string length
      //    and if the current and previous char are the same...
      //    ... or if 'x' is beyong the string length
      //    and the 2 previous chars are the same.
      o += ( x < l && i[ x ] == i[ x - 1 ] ) || ( x > 1 && i[ x - 1 ] == i[ x - 2 ] )
         
         // If true, add the index to the list of positions...
         ? ( x - 1 ) + " "
         
         // ...otherwise add nothing
         : "";
   
   // Return the list of positions.
   return o;
};
```
---
**Full code**
```
using System;
using System.Collections.Generic;
namespace Namespace {
   class Program {
      static void Main( String[] args ) {
         Func<String, String> f = i => {
            // List of positions
            var o = "";
            
            // Cycle through the string
            for( int x = 1, l = i.Length; x <= l; x++ )
               // Check if 'x' is below the string length
               //    and if the current and previous char are the same...
               //    ... or if 'x' is beyong the string length
               //    and the 2 previous chars are the same.
               o += ( x < l && i[ x ] == i[ x - 1 ] ) || ( x > 1 && i[ x - 1 ] == i[ x - 2 ] )
                  
                  // If true, add the index to the list of positions...
                  ? ( x - 1 ) + " "
                  
                  // ...otherwise add nothing
                  : "";
            
            // Return the list of positions.
            return o;
         };
         List<String>
            testCases = new List<String>() {
               "ABCDCABCD",
               "AABBCCDD",
               "ABCDDDCBA",
               "",
               "A",
               "AA",
               "AAA",
         };
         foreach( String testCase in testCases ) {
            Console.WriteLine( $"{testCase}\n{f( testCase )}\n" );
         }
         Console.ReadLine();
      }
   }
}
```
---
**Releases**
* **v1.0** - `115 bytes` - Initial solution.
---
**Notes**
Nothing to add
[Answer]
# C, 75 bytes
```
i;f(char*s){for(i=0;*s;++s,++i)if(s[1]==*s|(i&&s[-1]==*s))printf("%d ",i);}
```
Uses spaces as delimiters. (A trailing comma doesn't look too good.)
[Try it online!](https://tio.run/nexus/c-gcc#bYu9CsMwEIP3PIUxJNzZKbSz8eCftwgdQovpDU2DL53SPLvjUOhUDULShwqZBLfHmBXjml4ZyJ6NYqM191oTUgIeLldrFX@Auo6H07chzpmmJYFs70L2hGYrtYvnSBNgszaiqlLnQwyHSTTze2GQNfyg8z6E@J/VT4zBu2Pbyg4)
[Answer]
# JavaScript, 52 bytes
Thanks @Neil for golfing off 1 byte
```
x=>x.map((a,i)=>a==x[++i-2]|a==x[i]&&i).filter(a=>a)
```
Receives input as a 0-indexed array of characters  
Returns output as a 1-indexed array
## Explanation
```
x.map()
```
For each character in the string
```
(a,i)=>(a==x[++i-2]|a==x[i])*i
```
If it is equal to the previous character or the next character, return the index+1 otherwise do not return (leaves undefined in the array)
```
.filter(a=>a)
```
Remove all undefined elements from the resulting array
[Try it online!](https://tio.run/nexus/javascript-node#TU3LDsIgEDzrZ/S0ay2J3rc/0pCwsVDWYCHCgYP/jqQXndNM5uWoVZqrenEC4KsgzcBEdRlHme76c3DReBFUTkKx727PjO0R9xyDVSFuAIUcJBq4I6@rc3bz3ktXg8opSDEGUT2j7OZk8PxfLcdzn0wLTzf9S7Uv)
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 8 bytes
```
=2\T’œ|$
```
[Try it online!](https://tio.run/nexus/jelly#@29rFBPyqGHm0ck1Kv8Ptz9qWuP@/7@6o5OzizOIUNdRUHd0dHJydnaBsIFiLi7OTo7qAA "Jelly – TIO Nexus")
[Answer]
# k, 18 bytes
```
{?,/-1 0+/:&:=':x}
```
Examples:
```
k){?,/-1 0+/:&:=':x}"AABCDDDCBAA"
0 1 4 5 6 9 10
k){?,/-1 0+/:&:=':x}"ABCDCBA"
()
```
Translation to `q` is easier to understand:
```
{distinct raze -1 0+/:where not differ x}
```
[Answer]
# Python 2, ~~55~~ 54 bytes
```
m=j=0
for i in input():
 if m==i:print~-j,j,
 j+=1;m=i
```
[Try it Online!](https://tio.run/nexus/python2#@59rm2VrwJWWX6SQqZCZB0QFpSUamlZcCplpCrm2tplWBUWZeSV1ulk6WTpcClnatobWubaZ//@rOzo6Ojm7uKgDAA)
Outputs indices separated by spaces (note that this displays some indices twice as allowed by OP)
[Answer]
# C#, 89 Bytes
```
using System.Linq;s=>string.Join("",s.Skip(1).Select((a,i)=>a==s[i]?i+" "+(i+1)+" ":""));
```
If there are three or more characters in a row the indexes are repeated. Which @Comrade SparklePony allowed in the comments.
### Ungolfed full program:
```
using System;
using System.Collections.Generic;
using System.Linq;
namespace Namespace
{
    class Class1
    {
        static void Main(string[] args)
        {
            Func<string, string> f2 =
                s => string.Join("" ,         //Combine the results into one string
                s.Skip(1)                     //Start with the second element
                .Select(
                    (a, i) =>                 // 'a' is the current element, 'i' is the index of the element in the result of 'Skip'
                    a == s[i] ?               // therefore 's[i]' is the previous element; compare it with the current one
                    i + " " + (i + 1) + " " : //If true, return the indexes
                    ""                        //Otherwise an empty string
                ));
            var tests = new string [] {
               "ABCDCABCD",
               "AABBCCDD",
               "ABCDDDCBA",
               "ABBCDD"
            };
            foreach (var test in tests)
            {
                Console.WriteLine(test);
                Console.WriteLine(string.Join("", f2(test)));
                Console.WriteLine();
            }
            Console.ReadLine();
        }
    }
}
```
[Answer]
## [QBIC](https://drive.google.com/drive/folders/0B0R1Jgqp8Gg4cVJCZkRkdEthZDQ), 42 bytes
```
;[2,_lA||~mid$(A,a-1,1)=mid$(A,a,1)|?a-1,a
```
Sample output:
```
Command line: AADCDBBD
 1             2 
 6             7 
```
Explanation:
```
;               Get A$ from the cmd line
[2,    |        FOR a% = 2 TO
   _lA|              the length of A$
~mid$(A,a-1,1)  IF the character at index a%
=mid$(A,a,1)    equals the char at index a%-1
|               THEN
?a-1,a          PRINT both indexes, tab-separated
                Any further doubles are printed on a separate line
                The IF and FOR are closed implicitly
```
---
EDIT: QBIC now has Substring! This challenge can now be solved in 32 bytes:
```
;[2,_lA||~_sA,a-1|=_sA,a||?a-1,a
```
Where:
```
_s      This is the substring function; it takes 1, 2 or 3 arguments. 
        Arguments are comma-seperated, the list is delimited with |
        In this answer we see Substring take 2 arguments:
  A,    The string to take from
    a|  Starting position (note:uppercase represents strings, lowercase is for nums)
        Any omitted argument (in this case 'length to take') is set to 1.
```
[Answer]
# [Go](https://go.dev), 116 bytes
```
func f(s string)map[int]int{L,l:=make(map[int]int),'0'
for i,r:=range s{if r==l{L[i-1]=i;L[i]=i}else{l=r}}
return L}
```
[Attempt This Online!](https://ato.pxeger.com/run?1=TY89asQwEIV7nWIQLGuDNiRdcFDAP6WL9I4JQkhGrCUbSU4jVOcQaUwgh8hRcpvI9hYpZubNFO998_k1TOvPzPiVDQI0UwYpPU_W32GpPf5evLw8_nq5GA4yc-C8VWbINZs7ZXyfKrRkLKhmV5H9u-bkfH9GcrKgiC2oZSbZu6AkWErH0Hbq8tBT9ZREGlGMToSR2hiRFX6xBtp4y_7YszeyLIeAOHPCQUGh6w-WgMuqbuqtYYLLsqrqutllujRNXZW73hYcd6I3wjeDg-nwC-gleXmZ4ZMD-gyn91eDCXCSnuZ5jiK64azrMf8A)
Returns a map where the keys are the 0-based indexes of adjacent characters.
### [Go](https://go.dev), 141 bytes
```
func f(s string)(O[]int){L,l:=make(map[int]int),'0'
for i,r:=range s{if r==l{L[i-1]=i;L[i]=i}else{l=r}}
for k:=range L{O=append(O,k)}
return}
```
[Attempt This Online!](https://ato.pxeger.com/run?1=NZDNSsUwEIX3eYoQuNwUckV3UonQn2Wh7muREJMS2qYlSd2ErF35BG6K4EP4KL6NaXvdzJw5MGc-5vOrm9afmfGedQKOTGmgxnky7gbJ0aHvxcnL_e-HXDSHEltonVG6S3DdtEq7xFdkSOnIeoFHNjfR2m1yvj0DORmoiEmpYTpmW68kNJQOvmrU5a6l6iGK2IIYrPADNSHsO_3_RuVryuZZ6Fdckz4JwAi3GB2uUO871IaME-gBZ1ZYmFLYtAekR1lelMVWEEFZludFUe4yOmVZ5NmutwEdl18I3wKO60eeB08xy0mMThbSR3h6e9aIQE7iN3iSgACuOOt69D8)
Returns a slice that is the 0-based indexes of the adjacent characters.
[Answer]
# [Perl 5](https://www.perl.org/), 37 bytes
35 bytes of code + `pl` flags.
```
s/(?<=(.))\1|(.)(?=\2)/print pos/ge
```
[Try it online!](https://tio.run/nexus/perl5#U1YsSC3KUdDNy/lfrK9hb2OroaepGWNYA6Q07G1jjDT1C4oy80oUCvKL9dNT//93dHJ2cXFxdnIEAA "Perl 5 – TIO Nexus")
`(?<=(.))\1|(.)(?=\2)` will match either between two repeted characters (`(?<=(.))\1`), or before a character that is repeated (`(.)(?=\2)`).  
Then, `print pos` prints the position of the match. (`pos` contains the index of the current match when used in a regex with `/g` modifier).
[Answer]
# [Perl 6](https://perl6.org), ~~66~~ 57 bytes
```
*.comb.rotor(2=>-1).kv.flatmap({($^a,$a+1)xx[eq] $^b[0,1]}).squish
```
[Try it](https://tio.run/nexus/perl6#TZDfboIwFIfv@xTnAmcrpZluc4kokT@Xu9wd4IJQMzIQtMVoDHuhvcVejLXNXHZz2vR8/fI7pxMcTnOWu6i@wF3eFBxWw4TlTb1lx0Y2Rzxbec6UsI8T21WZrLMWX7G1yaiV2VNyPsf8kIK12cb3dJr2hIlDV4r3wfjWkgsJK6jKPReYMPV5cUUA9ULoA8Balvu2k55i8DL2gzBKPZuY1tjxxuYSr5f83PJc8kJzSWGnExiNYEx1v3dV@bx5qP399Q9nL6WQ1HpDPerUnK8qjYvaKtuDbaK5aNccf1M6HuDEWGhyE9Ck4CInoMOWwik4b6sL6CVhQxIKfyhoFPWDHiLURRmR7wdBGEYRaL1aEJ3RB/pIn@icPiMNRVEY@Lppnn8A "Perl 6 – TIO Nexus")
```
{m:ex/[(.)<($0|(.))>$0]{make $/.from}/».ast.sort.squish}
```
[Try it](https://tio.run/nexus/perl6#TZDLboMwEEX3/opZkALFmPSVSkBQeCy77A5QhcBRUXkVQ5WI0h/qJ3SXH6O221TdzFhzj@7c8cgovG1I7qD6CBd5W1DYLlNt04MVa0R3NWX9zrvuKet0qrMXCopF9n1bz9bpi2RsIKzteXkdS/Y8L9JmN1A2wBaqsqFM00mddfaEAGqbiQaguGXTjYPHGc2N/SCMUs/QpaSaniof8c6lh47mAy0ElxRGegmrFahY6LPDy8fZBxunz384eSjZgJUnNKORn/fI0zioq7IGDBnNQfu2/01peqAl0gUnZwOcFJTlOoiwJTMLSrvqCOJvNEnqPwvgjwfBo3kRl4SicFvk@0EQhlEEYscaX@FrfINv8R3e4HskoCgKA1@IcvwN "Perl 6 – TIO Nexus")
[Answer]
# PHP, 100 Bytes
```
for(;$i<strlen($s=$argn);$i++)$s[$i]==$s[$i+1]||$s[$i]==$s[$i-1]&&$i?$r[$i]=+$i:0;echo join(",",$r);
```
[Answer]
# [Ruby](https://www.ruby-lang.org/), 51+1 = 52 bytes
Uses the `-n` flag.
```
i=0;d=[];gsub(/./){$&==$_[i+=1]?d+=[i-1,i]:0};p d&d
```
[Try it online!](https://tio.run/nexus/ruby#U1YsKk2qVNDN@59pa2CdYhsda51eXJqkoa@nr1mtomZrqxIfnaltaxhrn6JtG52pa6iTGWtlUGtdoJCilvL/v6OTs4uLi7OToyMA "Ruby – TIO Nexus")
[Answer]
## Batch, 139 bytes
```
@set/ps=
@set/ai=c=0
:l
@if %s:~,1%==%s:~1,1% set c=2
@if %c% gtr 0 echo %i%
@set/ai+=1,c-=1
@if not "%s:~1%"=="" set s=%s:~1%&goto l
```
Takes input on STDIN. Works by keeping track of how many numbers to print in the `c` variable, which is reset to 2 when a pair is detected. Note: At a cost of 6 bytes, could be hardened to work with most ASCII characters and not just `ABCD`.
[Answer]
# k, 14 bytes
This is a function, it takes in a string, and returns a list of indices.
```
&{x|1_x,0}@=':
```
Explanation:
```
           =': /compare each letter to the previous, return binary list
 {       }@    
    1_x,0      /shift left
  x|           /combine shifted and unshifted with binary or
&              /get indices of 1s
```
[Try it online!](http://johnearnest.github.io/ok/?run=%28%26%7Bx%7C1_x%2C0%7D%40%3D%27%3A%29%27%28%22ABCDCABCD%22%3B%22AABBCCDD%22%3B%22ABCDDDCBA%22%3B%22ABBCDD%22%29)
How to use:
```
&{x|1_x,0}@=':"STRINGGOESHERE"
```
[Answer]
# [Julia 1.3](https://julialang.org), 23 bytes
```
!x=findall(r"(.)\1+",x)
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m700qzQnM3HBgqWlJWm6FtsVK2zTMvNSEnNyNIqUNPQ0Ywy1lXQqNCGyN3XT8osUMhUy8xSKUhNTcjLzUos1NLkUgKCgKDOvJCdPI1PB1k5BMVOTKzUvBaJpwU1lRydnF2cQweXo6OTk7OwCZAB5Li7OTo5cIBEXF4haAA)
in Julia 1.3+, there is a function that does the job for me. The output is a list of ranges, which are equivalent to lists (`4:6 == [4,5,6]`)
[+6 bytes if this format is not accepted](https://ato.pxeger.com/run?1=m700qzQnM3HBgqWlJWm6FnsVK2yj0zLzUhJzcjSKlDT0NGMMtZV0KjT19PSsYyFqbuqm5RcpZCpk5ikUpSam5GTmpRZraHIpAEFBUWZeSU6eRqaCrZ2CYqYmV2peCkTTgpvKjk7OLs4ggsvR0cnJ2dkFyADyXFycnRy5QCIuLhC1AA)
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 10 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
Input as a character array, output as a 2D array.
```
ò¦ m£T°ÃlÉ
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&header=cQ&code=8qYgbaNUsMNsyQ&input=IkFCQkNERCIKLVE)
```
ò¦ m£T°ÃlÉ     :Implicit input of array U
ò              :Partition on
 ¦             :  Inequality
   m           :Map
    £          :  Map
     T°        :    Postfix increment T, initially 0
       Ã       :End map
        l      :Filter by length
         É     :  Minus 1 (0 is falsey)
```
[Answer]
# PHP, 70 bytes
```
for(;a&$c=$argn[$i];)$i++&&$argn[$i-2]==$c||$argn[$i]==$c?print$i._:0;
```
takes input from STDIN; run with `-R`.
[Answer]
# [JavaScript (V8)](https://v8.dev/), 64 bytes
```
x=>x.replace(/(.)\1+/g,f=(s,i,p)=>print(p)+s[i=-~i]&&f(s,i,1+p))
```
[Try it online!](https://tio.run/##HcnBCkBAEADQuw9hpl3kpjQKm5/AYRMaSdOu5OTXV3nXt9vb@tmxXOldhp7CQ/WTuUUOOy@QQ4ZjofJNrwResxakWhyfFwgqPzClL09xvP5ZKEEMVdRD0rSdMaZrmwSr8AE "JavaScript (V8) – Try It Online")
Not that short but fun
# [JavaScript (Node.js)](https://nodejs.org), 45 bytes "by" fəˈnɛtɪk
```
x=>x.flatMap((a,i)=>a==x[++i-2]|a==x[i]?i:[])
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/e9m@7/C1q5CLy0nscQ3sUBDI1EnU9PWLtHWtiJaWztT1yi2BszOjLXPtIqO1fxvzZWcn1ecn5Oql5OfruGmEa2np6fu6OTs4uLi7OSoHqupaf0fAA "JavaScript (Node.js) – Try It Online")
[Answer]
# [><>](https://esolangs.org/wiki/Fish), ~~48~~ 47 bytes
```
0ril3(?;3[$::}@=r$:@e1.
=r{+]?\{1+}20.
}oan:{/1
```
[Try it online!](https://tio.run/##S8sszvj/36AoM8dYw97aOFrFyqrWwbZIxcoh1VCPy7aoWjvWPqbaULvWyECPqzY/Mc@qWt/w////usWOTs4uLi7OTo4A "><> – Try It Online")
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 6 bytes
```
₌ẏĠ•~Ḣ
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyIiLCIiLCLigozhuo/EoOKAon7huKIiLCIiLCJBQkJCQkNERCJd)
Similar stuff to the other answers but independently derived.
## Explained
```
₌ẏĠ•~Ḣ
₌ẏĠ    # range(0, len(input)) and group_consecutive(input)
   •   # mold the length range to the shape of the consecutive groups
    ~Ḣ # keep only lists where there's more than one item
```
]