Why are regular expressions greedy by default?
Hysterical Raisens Part of the answer may involve the origins of REs in practical computing. They were originally a theoretical concept from automata theory and formal language theory until Ken Thompson himself wrote a real implementation and used them in qed and ed(1). The original version had only the greedy syntax and so there wasn’t … Read more