regexp: simpler non-greedy implementation