fork(1) download
  1. import re
  2. s = '00101010111111100001011'
  3. rx = r'00[01]*?11'
  4. print([(x.start(),x.end()) for x in re.finditer(rx, s)])
Success #stdin #stdout 0s 23352KB
stdin
Standard input is empty
stdout
[(0, 10), (15, 23)]