[core][js][fr] JavaScript sucks: avoid weird and unpredictable behavior, infinite loop and similar crazyness -> stable number of groups in regex