Maximum length of a string that will be compiled by new RegExp(...).
Patterns that exceed this cap are rejected without compilation. A
pathological pattern (e.g. (a+)+) doesn't need to be long to hang,
but the cap is cheap defence and stops obviously hostile input before
it reaches the regex engine.
Maximum length of a string that will be compiled by
new RegExp(...). Patterns that exceed this cap are rejected without compilation. A pathological pattern (e.g.(a+)+) doesn't need to be long to hang, but the cap is cheap defence and stops obviously hostile input before it reaches the regex engine.