I have a binary number, for example 10000111000011, and want to split it into groups of consecutive 1s and 0s, 1 0000 111 0000 11.
10000111000011
1 0000 111 0000 11
I though
(?<=0)(?=1)|(?<=1)(?=0)
Simply split by this.See demo.
https://regex101.com/r/fM9lY3/3
The lookarounds will find place where there is 0 behind and 1 ahead or 1 behind and 0 ahead.Thus resulting in correct split without consuming anything.
lookarounds
0
1