/usr/include/boost/regex/v4
NameSizeModeActions
basic_regex.hpp240890644editdlrm
basic_regex_creator.hpp542060644editdlrm
basic_regex_parser.hpp1128510644editdlrm
char_regex_traits.hpp17260644editdlrm
cpp_regex_traits.hpp394250644editdlrm
cregex.hpp109870644editdlrm
c_regex_traits.hpp54970644editdlrm
error_type.hpp12580644editdlrm
fileiter.hpp143770644editdlrm
indexed_bit_flag.hpp13160644editdlrm
instances.hpp90800644editdlrm
iterator_category.hpp19600644editdlrm
iterator_traits.hpp38020644editdlrm
match_flags.hpp69340644editdlrm
match_results.hpp227730644editdlrm
mem_block_cache.hpp31320644editdlrm
perl_matcher.hpp188470644editdlrm
perl_matcher_common.hpp304760644editdlrm
perl_matcher_non_recursive.hpp632380644editdlrm
perl_matcher_recursive.hpp345400644editdlrm
primary_transform.hpp33470644editdlrm
protected_call.hpp16880644editdlrm
regbase.hpp59720644editdlrm
regex.hpp45900644editdlrm
regex_format.hpp342310644editdlrm
regex_fwd.hpp16460644editdlrm
regex_grep.hpp48790644editdlrm
regex_iterator.hpp64740644editdlrm
regex_match.hpp144750644editdlrm
regex_merge.hpp27650644editdlrm
regex_raw_buffer.hpp36860644editdlrm
regex_replace.hpp29250644editdlrm
regex_search.hpp70970644editdlrm
regex_split.hpp49560644editdlrm
regex_token_iterator.hpp126130644editdlrm
regex_traits.hpp49650644editdlrm
regex_traits_defaults.hpp115550644editdlrm
regex_workaround.hpp61710644editdlrm
states.hpp119150644editdlrm
sub_match.hpp231550644editdlrm
syntax_type.hpp43740644editdlrm
u32regex_iterator.hpp64750644editdlrm
u32regex_token_iterator.hpp150680644editdlrm
w32_regex_traits.hpp244550644editdlrm
Edit: /usr/include/boost/regex/v4/regex_split.hpp (4956B)
/* * * Copyright (c) 1998-2002 * John Maddock * * Use, modification and distribution are subject to the * Boost Software License, Version 1.0. (See accompanying file * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * */ /* * LOCATION: see http://www.boost.org for most recent version. * FILE regex_split.hpp * VERSION see * DESCRIPTION: Implements regex_split and associated functions. * Note this is an internal header file included * by regex.hpp, do not include on its own. */ #ifndef BOOST_REGEX_SPLIT_HPP #define BOOST_REGEX_SPLIT_HPP namespace boost{ #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif #ifdef BOOST_MSVC #pragma warning(pop) #endif #ifdef BOOST_MSVC # pragma warning(push) #if BOOST_MSVC < 1910 #pragma warning(disable:4800) #endif #endif namespace BOOST_REGEX_DETAIL_NS{ template const basic_regex& get_default_expression(charT) { static const charT expression_text[4] = { '\\', 's', '+', '\00', }; static const basic_regex e(expression_text); return e; } template class split_pred { typedef std::basic_string string_type; typedef typename string_type::const_iterator iterator_type; iterator_type* p_last; OutputIterator* p_out; std::size_t* p_max; std::size_t initial_max; public: split_pred(iterator_type* a, OutputIterator* b, std::size_t* c) : p_last(a), p_out(b), p_max(c), initial_max(*c) {} bool operator()(const match_results& what); }; template bool split_pred::operator() (const match_results& what) { *p_last = what[0].second; if(what.size() > 1) { // output sub-expressions only: for(unsigned i = 1; i < what.size(); ++i) { *(*p_out) = what.str(i); ++(*p_out); if(0 == --*p_max) return false; } return *p_max != 0; } else { // output $` only if it's not-null or not at the start of the input: const sub_match& sub = what[-1]; if((sub.first != sub.second) || (*p_max != initial_max)) { *(*p_out) = sub.str(); ++(*p_out); return --*p_max; } } // // initial null, do nothing: return true; } } // namespace BOOST_REGEX_DETAIL_NS template std::size_t regex_split(OutputIterator out, std::basic_string& s, const basic_regex& e, match_flag_type flags, std::size_t max_split) { typedef typename std::basic_string::const_iterator ci_t; //typedef typename match_results::allocator_type match_allocator; ci_t last = s.begin(); std::size_t init_size = max_split; BOOST_REGEX_DETAIL_NS::split_pred pred(&last, &out, &max_split); ci_t i, j; i = s.begin(); j = s.end(); regex_grep(pred, i, j, e, flags); // // if there is still input left, do a final push as long as max_split // is not exhausted, and we're not splitting sub-expressions rather // than whitespace: if(max_split && (last != s.end()) && (e.mark_count() == 0)) { *out = std::basic_string((ci_t)last, (ci_t)s.end()); ++out; last = s.end(); --max_split; } // // delete from the string everything that has been processed so far: s.erase(0, last - s.begin()); // // return the number of new records pushed: return init_size - max_split; } template inline std::size_t regex_split(OutputIterator out, std::basic_string& s, const basic_regex& e, match_flag_type flags = match_default) { return regex_split(out, s, e, flags, UINT_MAX); } template inline std::size_t regex_split(OutputIterator out, std::basic_string& s) { return regex_split(out, s, BOOST_REGEX_DETAIL_NS::get_default_expression(charT(0)), match_default, UINT_MAX); } #ifdef BOOST_MSVC # pragma warning(pop) #endif #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif #ifdef BOOST_MSVC #pragma warning(pop) #endif } // namespace boost #endif