I had a task, where i used replaceAll regex method and could not pass many tests in Yandex Contest testing system, but locally everything seems to work properly. I decided to use replace with g modifier instead, and all tests passed. I wonder what was the problem exactly?
Do you mean you didn't include the g modifier when using relaceAll?
As stated in the documentation of replaceAll
A RegExp without the global ("g") flag will throw a TypeError: "replaceAll must be called with a global RegExp".