in reply to Why doesn't non-greediness work?
What makes you think it doesn't work?
Think about it for a sec. /<img(.+?)="Smiley">/ first matches <img at the beginning of the line.
Then it slurps everything until "Smiley">
You may ask, well, why doesn't it stop at "Wink"> ? Why should it? You specifically told it to look for "Smiley"> ;)
If you reverse the order in which you apply the s///-es, it'll work. In this particular case that is.
--perlplexer