Make a regex that matches certain binary numbers
The following regex

(?=^1*(01*0)*1*$)^.(..)*$


works in many languages. It performs a perfect match for any binary of arbitrary length.

Basically, it consists of two parts which are joined via and by using a lookahead pattern:


^1*(01*0)*1*$ matches if an even number of zeros is provided.
^.(..)*$ tests for an odd number of digits in total.


The test run can be seen here.