It looks like your first byte is ASCII 10, which is a line feed. Is that breaking the regex because it's hitting an EOL? What if you change the "s" modifier to an "m" modifier so it will match over EOLs within the string?
Does it also fail when you get that pattern "00001010" anywhere else in the first four bytes?
If that's the problem it should fail if you get
0000 1011 (vertical tab) 0000 1100 (form feed) 0000 1101 (carriage return)
If you're interpreting as Unicode you might also see failures if you get a few other combinations that don't start with 0000 that get interpreted as premature EOL and cause it to fail.
(Edit: looks like GrandFather posted a better solution than changing the match mode. Dropping the anchors is simpler.)
In reply to Re^3: Pattern match not working sometimes
by bitingduck
in thread Pattern match not working sometimes
by dantheman1210
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |