REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
Loading...
Searching...
No Matches
config.hpp File Reference

Resource limits guarding against pattern-driven resource exhaustion. More...

#include "real/version.hpp"
#include <cstddef>
#include <cstdint>
#include <string_view>
Include dependency graph for config.hpp:

Namespaces

namespace  real
 REAL's public API: real::regex, real::static_regex, real::flags and the match/iterator types built on them.
 
namespace  real::detail
 DFA construction internals: subset construction over a flattened NFA. Not a stable API.
 

Variables

constexpr std::size_t real::detail::default_max_program_size {262144}
 max_program_size's default.
 
constexpr std::int32_t real::detail::default_max_repeat_count {1000}
 max_repeat_count's default.
 
constexpr std::int32_t real::detail::default_max_group_count {32766}
 max_group_count's default.
 
constexpr std::int32_t real::detail::default_max_nesting_depth {200}
 max_nesting_depth's default.
 
constexpr std::int32_t real::detail::default_max_lookaround_length {255}
 max_lookaround_length's default.
 
constexpr std::size_t real::detail::default_max_dfa_states {65536}
 max_dfa_states's default.
 
constexpr std::size_t real::detail::max_program_size {default_max_program_size}
 Maximum number of NFA instructions in a compiled program — 256 Ki by default (REAL_MAX_PROGRAM_SIZE).
 
constexpr std::string_view real::detail::program_too_large {"program too large"}
 The cause a program past max_program_size is rejected with (real::regex_error::cause).
 
constexpr std::int32_t real::detail::max_repeat_count {default_max_repeat_count}
 Per-quantifier bounded-repeat cap, enforced at parse time (REAL_MAX_REPEAT_COUNT).
 
constexpr std::int32_t real::detail::max_group_count {default_max_group_count}
 Maximum capture groups; bounds slot_count = 2 * (groups + 1) (REAL_MAX_GROUP_COUNT).
 
constexpr std::int32_t real::detail::max_nesting_depth {default_max_nesting_depth}
 Maximum parser recursion depth; prevents stack overflow on deep nesting (REAL_MAX_NESTING_DEPTH).
 
constexpr std::int32_t real::detail::max_lookaround_length {default_max_lookaround_length}
 Maximum bytes a bounded lookaround sub-pattern may consume (its L_max); bounding it keeps per-position evaluation linear (REAL_MAX_LOOKAROUND_LENGTH).
 
constexpr std::size_t real::detail::max_dfa_states {default_max_dfa_states}
 Maximum DFA states (opt-in real::dfa; REAL_MAX_DFA_STATES).
 

Detailed Description

Resource limits guarding against pattern-driven resource exhaustion.