Given a series of bits, e.g 10100011110010101
and 010001001010100
.
How can I write a regular expression to reflect the patterns where no 1s are neighbors?
For example, 010001001010100
is a good one, but 10100011110010101
is not as there are 1s neighboring.
edit:
Sorry my above statement may be misleading. i don't want to check whether a sequence is non-1-neighboring. I want to use an regex to find all non-1-neighborings.
Assume I have a very lone series of bits, I want to write a regex to find out all sub sequences where no 1s are neighbors.