flâneur — a map of the web's best reading

An additional non-backtracking RegExp engine · V8

v8.dev · 1,802 words · saved by 1 readers

V8 now has an additional RegExp engine that serves as a fallback and prevents many instances of catastrophic backtracking.

Starting with v8.8, V8 ships with a new experimental non-backtracking RegExp engine (in addition to the existing Irregexp engine ) which guarantees execution in linear time with respect to the size of the subject string. The experimental engine is available behind the feature flags mentioned below. Runtime of /(a*)*b/.exec('a'.repeat(n)) for n ≤ 100 Here’s how you can configure the new RegExp engine: --enable-experimental-regexp_engine-on-excessive-backtracks enables the fallback to the non-backtracking engine on excessive backtracks. --regexp-backtracks-before-fallback N (default N = 50,000)

Explore this link on the map →

saved by

related reading