Your task is to create a regular expression that matches most binary numbers with an even number of 0
s and an odd number of 1
s (e.g. "101100011"
).
The full criteria for the regex are:
- matches 90% or more of all binary numbers between
0
and11111111
with even number of0
s and an odd number of1
s, - doesn't match 90% or more of all binary numbers between
0
and11111111
with odd number of0
s or an even number of1
s, - works in most common programming languages.
Ideally, it should be short and creative.
The input string always has a length that is greater than 1, less than infinity, and only contains 1
s and 0
s.
I will upvote any answer that seriously attempts to match the above criteria. Once the activity around this question dies down, I'll accept the highest-voted answer that is at least only 1.333... times the length of the shortest answer.