I am stuck with a problem that challenges me to create the regular expression for binary numbers (containing 0
s and 1
s). But the string should only match if the binary number only contains a maximum of five 1
s. How do I limit a character appearance in a regex?
Examples:
01101101
is correct01111100
is correct10110011
is correct01111110
is wrong11111110
is wrong