REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
Loading...
Searching...
No Matches
real::basic_match_range< Storage > Class Template Reference

A range of matches, returned by find_iter() and usable in range-for. More...

#include <real.hpp>

Collaboration diagram for real::basic_match_range< Storage >:
[legend]

Public Member Functions

constexpr basic_match_range (detail::program_view prog, std::string_view pattern, std::string_view text, std::size_t start=0, match_semantics sem=match_semantics::first)
 Binds the range to a program and text.
 
constexpr basic_match_iterator< Storage > begin () const
 Returns an iterator to the first match.
 
constexpr basic_match_iterator< Storage > end () const
 Returns the end sentinel.
 

Private Attributes

detail::program_view prog_
 The program being run.
 
std::string_view pattern_
 Pattern text (named lookups).
 
std::string_view text_
 The text to iterate.
 
std::size_t start_ {}
 Byte offset to begin iterating from (region support).
 
match_semantics sem_ {match_semantics::first}
 leftmost-first (default) or longest.
 

Detailed Description

template<typename Storage>
class real::basic_match_range< Storage >

A range of matches, returned by find_iter() and usable in range-for.

Template Parameters
StorageThe regex's storage policy.

Definition at line 407 of file real.hpp.

Constructor & Destructor Documentation

◆ basic_match_range()

template<typename Storage >
constexpr real::basic_match_range< Storage >::basic_match_range ( detail::program_view  prog,
std::string_view  pattern,
std::string_view  text,
std::size_t  start = 0,
match_semantics  sem = match_semantics::first 
)
inlineconstexpr

Binds the range to a program and text.

Parameters
[in]progThe compiled program.
[in]patternThe pattern text (for named-group resolution).
[in]textThe text to iterate over (borrowed).
[in]startByte offset to begin iterating from (0 = the whole text).
[in]semMatch semantics: leftmost-first (default) or the experimental leftmost-longest.

Definition at line 419 of file real.hpp.

Member Function Documentation

◆ begin()

template<typename Storage >
constexpr basic_match_iterator< Storage > real::basic_match_range< Storage >::begin ( ) const
inlineconstexpr

Returns an iterator to the first match.

Definition at line 434 of file real.hpp.

◆ end()

template<typename Storage >
constexpr basic_match_iterator< Storage > real::basic_match_range< Storage >::end ( ) const
inlineconstexpr

Returns the end sentinel.

Definition at line 442 of file real.hpp.

Member Data Documentation

◆ pattern_

template<typename Storage >
std::string_view real::basic_match_range< Storage >::pattern_
private

Pattern text (named lookups).

Definition at line 450 of file real.hpp.

◆ prog_

template<typename Storage >
detail::program_view real::basic_match_range< Storage >::prog_
private

The program being run.

Definition at line 449 of file real.hpp.

◆ sem_

template<typename Storage >
match_semantics real::basic_match_range< Storage >::sem_ {match_semantics::first}
private

leftmost-first (default) or longest.

Definition at line 453 of file real.hpp.

◆ start_

template<typename Storage >
std::size_t real::basic_match_range< Storage >::start_ {}
private

Byte offset to begin iterating from (region support).

Definition at line 452 of file real.hpp.

◆ text_

template<typename Storage >
std::string_view real::basic_match_range< Storage >::text_
private

The text to iterate.

Definition at line 451 of file real.hpp.


The documentation for this class was generated from the following file: