Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
r"
(?mx) ( # the 1st capture group will contain this sequence 1 # this sequence should begin with 1 (?=(?:[01]{6,19}) # let's see that there are enough 0s and 1s in a line (.*$)) # the 2nd capture group will contain all characters to the end of a line (?:0*1){6}) # there must be six more 1s in the sequence (?=.{0,13} # complement the 1st capture group to 20 characters \2) # the rest of a line should be 2nd capture group
"
gm
Unit Tests
There are no unit tests, click
here
to add some.