I believe the host name has to match exactly, so you might try www.yahoo.com if that’s what you’re typing into your browser. I don’t think the hosts file on Windows allows wildcards either, although I stand to be corrected.
Oh, and it’s possible that you need to flush your DNS cache for it to work. I can’t remember in what order things get checked (i.e. if it’s hosts file, then cache, or cache then hosts file). Open a command prompt and type “ipconfig /flushdns” to clear the cache.