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
Input 1
1
New
0000000 101010101010111111100000000000001 00000001100000001110111100000000000000000000000000000000000000000000000000110000000111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001100 1111111 111111
Substitution