fork(1) download
  1. import re
  2.  
  3. s = 'start hamlet of just 50 year-round start residents lacks a grocery store end or even a gasoline station'
  4.  
  5. print(re.search(r'start((?!.*start.*).*)end', s).group(1))
  6.  
Success #stdin #stdout 0.02s 9488KB
stdin
Standard input is empty
stdout
 residents lacks a grocery store