In JavaScript, regular expression objects have state. This matters when the flag ("global") is applied to them, and sometimes applies in odd ways. This state is the index where the match last occurred, which is the regex's property. When you call or on the same regex object again, it picks up from where it left off.
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile