Std.Regex.stepLimit
1 declaration
fn
stepLimit: IntThis is a callable function.
What it does
How many instructions one search may run before it gives up.
A backtracking search over a pattern like (a+)+b can take time
exponential in the length of the subject, and a pattern is often written by
someone other than whoever runs it — a rule in a configuration file, a
filter typed into a form. Without a bound, that is a way to stop a server
with one line of text.
The bound is on work rather than on time so that the same input decides the
same way on every machine. search reports reaching it; find and
isMatch answer "no match", which is the safe direction for a filter.
Read the signature
- The text after the name is the type checked by Pudu.
