Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36
Chrome 92
Windows
Desktop
3 years ago
Test name Executions per second
lookbehind 1996272.9 Ops/sec
normal 3227097.8 Ops/sec
lookforward 2125050.0 Ops/sec
Script Preparation code:
AخA
 
var re1 = /^(\d{0,9}(,?(?<=,)\d{0,2})?)(-?(?<=-)(\d{0,9}(,?(?<=,)\d{0,2})?))?$/;
var re2 = /^(\d{0,9}(,\d{0,2})?)(-(\d{0,9}(,\d{0,2})?))?$/;
var re3 = /^((?=(\d{0,9}))\2(,\d{0,2})?)(-((?=(\d{0,9}))\6(,\d{0,2})?))?$/;
Tests:
  • lookbehind

     
    re1.test('25500,33-33090,770');
  • normal

     
    re2.test('25500,33-33090,770');
  • lookforward

     
    re1.test('25500,33-33090,770');