in reply to About Greedy and Non-Greedy Regular Expressions

PerlPhi, welcome to the Monastery.

Your understanding is mostly correct. Under the hood, perl's RE engine does a lot of things to optimize how .+ and .+? work - you can see some of that if you compare

perl -Mre=debug -e'"Fred and Barney went bowling last night. Barney h +ad soup."=~/Fred.+?Barney/;'
and
perl -Mre=debug -e'"Fred and Barney went bowling last night. Barney h +ad soup."=~/Fred.+Barney/;'
But your "mental model" appears correct, if I'm following your long paragraph. :)

As marto pointed out, please check out the formatting rules. You can edit your own post, and add <p> in between paragraphs - that will help people understand your question.


Mike