Archive for July, 2005

Mozilla JavaScript RegExp Test Bug

Tuesday, July 5th, 2005

There is what some consider to be a bug in Mozilla’s JavaScript engine. Basically, if you run a regular expression with a global switch (e.g. /x/g), JavaScript remembers the last match position. This causes the RegExp to sometimes validate as true, and sometimes as false (alternatingly). The Mozilla guys say it isn’t a bug. However, removing the /g solves the problem.