Fix weird Firefox regexp with global flag bug