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

Unicode \w / \d / \s property ranges and their lookups. More...

#include "real/version.hpp"
#include <cstddef>
#include <cstdint>
#include <span>
#include "real/core/program.hpp"
Include dependency graph for unicode_props.hpp:

Go to the source code of this file.

Namespaces

namespace  real
 
namespace  real::detail
 

Functions

constexpr bool real::detail::cp_in_ranges (std::span< const code_range > ranges, char32_t cp)
 Binary-searches a sorted, non-overlapping range table for cp. Returns a bool (not a pointer into the table) so it stays constant-evaluable on every compiler.
 
constexpr bool real::detail::is_word_cp (char32_t cp)
 Whether cp is a Unicode word / digit / whitespace code point (== re \w/\d/\s).
 
constexpr bool real::detail::is_digit_cp (char32_t cp)
 
constexpr bool real::detail::is_space_cp (char32_t cp)
 

Variables

constexpr const char * real::detail::unicode_props_unidata_version {"16.0.0"}
 The Unicode data version these tables were generated from (16.0.0).
 
constexpr code_range real::detail::word_ranges []
 Code-point ranges matched by \w (771 ranges, 142940 code points).
 
constexpr std::size_t real::detail::word_ranges_size {771}
 
constexpr code_range real::detail::digit_ranges []
 Code-point ranges matched by \d (71 ranges, 760 code points).
 
constexpr std::size_t real::detail::digit_ranges_size {71}
 
constexpr code_range real::detail::space_ranges []
 Code-point ranges matched by \s (10 ranges, 29 code points).
 
constexpr std::size_t real::detail::space_ranges_size {10}
 

Detailed Description

Unicode \w / \d / \s property ranges and their lookups.

GENERATED by tools/gen_unicode_props.py – DO NOT EDIT BY HAND.

Built from, and exhaustively validated against, CPython's own re, so REAL's Unicode shorthand semantics equal re by construction. Unicode data version: 16.0.0 (asserted).

Definition in file unicode_props.hpp.