MCPcopy Create free account
hub / github.com/dlclark/regexp2 / OptionMaxBacktrackingStackSize

Function OptionMaxBacktrackingStackSize

options.go:110–114  ·  view source on GitHub ↗

OptionMaxBacktrackingStackSize limits the number of integer slots used by a match's backtracking stack. Negative values disable the limit. A match that exceeds the limit returns ErrBacktrackingStackLimit.

(n int)

Source from the content-addressed store, hash-verified

108// OptionMaxBacktrackingStackSize limits the number of integer slots used by a match's backtracking stack.
109// Negative values disable the limit. A match that exceeds the limit returns ErrBacktrackingStackLimit.
110func OptionMaxBacktrackingStackSize(n int) CompileOption {
111 return compileOptionFunc(func(c *compileConfig) {
112 c.optimizations.MaxBacktrackingStackSize = n
113 })
114}
115
116// OptionMaxCachedRuneBufferLength limits retained string-to-rune buffers in the shared size-classed pool.
117func OptionMaxCachedRuneBufferLength(n int) CompileOption {

Calls 1

compileOptionFuncFuncType · 0.85