35 using std::string_view;
41 : std::sregex_iterator
46 :
std::sregex_iterator{toParse.begin(), toParse.end(), regex}
49 :
std::sregex_iterator{string::const_iterator{toParse.begin()}
50 ,string::const_iterator{toParse.end()}, regex}
53 operator bool()
const {
return isValid(); }
55 bool isValid ()
const {
return (*this)->ready() and not (*this)->empty(); }
69 template<
typename STR>
74 if (search and 0 == search->position(0))
81 template<
typename STR>
85 static const regex LEADING_WHITESPACE{
"^\\s*", regex::optimize};
86 auto search =
RegexSearchIter{std::forward<STR> (toParse), LEADING_WHITESPACE};
87 return search? search->length() : 0;
Helper template(s) for creating Lumiera Forward Iterators.
Implementation namespace for support and library code.
size_t leadingWhitespace(STR &&toParse)
std::optional< smatch > matchAtStart(STR &&toParse, regex const ®ex)
Helper algorithm to perform a search but require the match to start at the beginning of the string or...
wrapped regex iterator to allow usage in foreach loops
RegexSearchIter(string_view toParse, regex const ®ex)
RegexSearchIter(string const &toParse, regex const ®ex)
LIFT_PARENT_INCREMENT_OPERATOR(std::sregex_iterator)
ENABLE_USE_IN_STD_RANGE_FOR_LOOPS(RegexSearchIter)
RegexSearchIter()=default