It rang a bell... Here's what's happening: the lastIndex property is not being reset. You can see that when you type a larger number, in which case "true" and "false" is not just alternated, it is "twice true, one false" for 2 digits plus one or more letters, and "thrice true, one false" for three digits plus one or more letters.
According to a blog post, it is the third most reported "bug" for Firefox:
Another historically problematic issue has been the fact that, according to ES3, regex literals cause only one object to be created at runtime for a script or function. This issue exhibits itself most frequently as regex literals which use the /g modifier not having their lastIndex property reset in some cases where most developers would expect it. Fortunately, this is already planned to be fixed in ES4. The fact that it has been the third most duplicated Firefox bug report undoubtedly had something to do with this decision.
In general, I would say, this is "not a bug". Actually: IE has it wrong here and Opera and Firefox do it well. And yes, that it is far from intuitive in this case...
I'm sure you have found a workaround: not using the "g" modifier, or resetting lastIndex by hand. Also, you could use $ and ^ to aid in your match.