PCRE2 matches by backtracking, so a pattern such as (a+)+b can take
time exponential in the length of the subject. zuregex makes no
linear-time promise; for that, use the re2 package. What it promises is
that limits bound the work per element, and that hitting one is either a
classed error or an NA you asked for.
Usage
re_limits(match = NULL, depth = NULL, heap = NULL, on_limit = c("error", "na"))Arguments
- match
The most times PCRE2's internal match function may be called for one search; PCRE2's default is 10,000,000. The JIT compiler honours it too.
- depth
The deepest backtracking nesting for one search; PCRE2's default equals
match. The JIT compiler ignores it.- heap
The most heap memory, in kibibytes, the interpreter may use for backtracking in one search; PCRE2's default is 20,000,000. The JIT compiler ignores it.
- on_limit
What an element that hits a limit gives:
"error"raises azuregex_error_limitnaming the limit and the element;"na"givesNAfor that element and one warning of classzuregex_warning_limitfor the call, counting how many did.