/^[01]{8}(?: [01]{8})*$/
/ : regex delimiter
^ : beginning of string
[01]{8} : 0 or 1, must appear 8 times
(?: : start non capture group
: 1 horizontal space
[01]{8} : 0 or 1, must appear 8 times
)* : end group, must appear 0 or more times
$ : end of line
/ : regex delimiter
var test = [
"11001100 01101111 11001011 00001011",
"00001100 11101111 11001000 00000001 11001011",
"11001100 1100101 01101111",
"11001100 01101111 11001011 00200011"
];
console.log(test.map(function (a) {
return a+' --> '+/^[01]{8}(?: [01]{8})*$/.test(a);
}));