(This is meant to be a comment, but I don't have enough reputation to add a comment yet...)
You just fried my brain. In my Cygwin, the same thing happens. I was shocked. It appears to be a bug in how the wildcards are handled, whether they are using regular expression syntax or glob-style (glob--style is where * means 'any number of any type of character', regular expression * means '0 or more of the previous characters'.
So I tried it in my QNX shell. It works IFF I don't try to use a plus before bug, as in "s/^ +bug-/__/". I can substitute a * in place of the + and it works. I think some implementations of sed are having a hard time picking regex or glob syntax and the result is an unpredictable mess.
I didn't try Perl (haven't installed it yet on this new machine), but I would be doubly shocked if Perl handled it as poorly.
To answer your question, to the best of my knowledge and ~100,000 of my closest friends on Google, your understanding of how the ^ operator should work is accurate.
what have you used there? cygwin's sed from cmd.exe ? That's cheating, you may as well use a windows port of sed. – barlop – 2013-02-12T18:47:29.747
OP said that was what he was doing (running Cygwin's sed executable from cmd.exe), so that was the source of his problem and that's why I answered that use case. :) I made sure to mention that running within a proper Cygwin env makes this workaround unnecessary, but I don't know his situation. Maybe that's not an option for him for some reason. – Costa – 2013-02-12T18:53:11.690
First, there is no cheating. Second, all sed instructors teach using single quotes. Third, single quotes work in Windows -- double quotes work in cygwin. Nothing mad here. Finally, I told that problem occurs in Windows. I told that I used cygwin bash only for testing. Nothing mad is here. You just cannot read. So, the only crazy person, who came here to produce dumps of garbage here is you. – Val – 2013-02-12T19:15:42.693