Constellation / iv

ECMAScript Lexer / Parser / Interpreter / VM / method JIT written in C++
BSD 2-Clause "Simplified" License
415 stars 32 forks source link

String replace has invalid result #70

Closed Constellation closed 12 years ago

Constellation commented 12 years ago

Probably, this is invalid result?

'123451111111'.replace(/(?=\d)(\d{3})(\d{3})+$/g, ',$1$2')
Constellation commented 12 years ago

And

 "1222".replace(/\B(?=(?:\d{3})+$)/g, ",")