Matching a binary string with 3 or more occurrences of '1'. Can this regex be improved?
^[0-1]*1[0-1]*1开发者_如何学编程[0-1]*1[0-1]*$
To match a binary string with 3 or more occurrences of '1' This expression works...just trying to make it better.
To match three or more occurrences of 1, I would use:
^(0*1){3}[01]*$
i think it'll be something like this, edited changed with alans suggestions
^(0*1){3,}0*$
精彩评论