in reply to Re: regex help humbly sought
in thread regex help humbly sought

WOW, i'm sure i've never tried .*? in a regex, so if that was supposed to make sense, ignore me

This example should clearly illustrate the difference.

$_ = '<S>abc<E> <S>def<E>'; print("Greedy:\n"); print(" $1\n") while /<S>(.*)<E>/g; print("Non-greedy:\n"); print(" $1\n") while /<S>(.*?)<E>/g;
Greedy: abc<E> <S>def Non-greedy: abc def