PATH:
opt
/
cpanel
/
ea-ruby27
/
src
/
passenger-release-6.1.2
/
src
/
cxx_supportlib
/
vendor-modified
/
boost
/
regex
/
v5
/* * * 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_grep.hpp * VERSION see <boost/version.hpp> * DESCRIPTION: Provides regex_grep implementation. */ #ifndef BOOST_REGEX_V5_REGEX_GREP_HPP #define BOOST_REGEX_V5_REGEX_GREP_HPP #include <boost/regex/v5/basic_regex.hpp> #include <boost/regex/v5/match_flags.hpp> #include <boost/regex/v5/match_results.hpp> #include <boost/regex/v5/perl_matcher.hpp> namespace boost{ // // regex_grep: // find all non-overlapping matches within the sequence first last: // BOOST_REGEX_MODULE_EXPORT template <class Predicate, class BidiIterator, class charT, class traits> inline unsigned int regex_grep(Predicate foo, BidiIterator first, BidiIterator last, const basic_regex<charT, traits>& e, match_flag_type flags = match_default) { if(e.flags() & regex_constants::failbit) return false; typedef typename match_results<BidiIterator>::allocator_type match_allocator_type; match_results<BidiIterator> m; BOOST_REGEX_DETAIL_NS::perl_matcher<BidiIterator, match_allocator_type, traits> matcher(first, last, m, e, flags, first); unsigned int count = 0; while(BOOST_REGEX_DETAIL_NS::factory_find(matcher)) { ++count; if(0 == foo(m)) return count; // caller doesn't want to go on if(m[0].second == last) return count; // we've reached the end, don't try and find an extra null match. if(m.length() == 0) { if(m[0].second == last) return count; // we found a NULL-match, now try to find // a non-NULL one at the same position: match_results<BidiIterator, match_allocator_type> m2(m); matcher.setf(match_not_null | match_continuous); if(BOOST_REGEX_DETAIL_NS::factory_find(matcher)) { ++count; if(0 == foo(m)) return count; } else { // reset match back to where it was: m = m2; } matcher.unsetf((match_not_null | match_continuous) & ~flags); } } return count; } // // regex_grep convenience interfaces: // BOOST_REGEX_MODULE_EXPORT template <class Predicate, class charT, class traits> inline unsigned int regex_grep(Predicate foo, const charT* str, const basic_regex<charT, traits>& e, match_flag_type flags = match_default) { return regex_grep(foo, str, str + traits::length(str), e, flags); } BOOST_REGEX_MODULE_EXPORT template <class Predicate, class ST, class SA, class charT, class traits> inline unsigned int regex_grep(Predicate foo, const std::basic_string<charT, ST, SA>& s, const basic_regex<charT, traits>& e, match_flag_type flags = match_default) { return regex_grep(foo, s.begin(), s.end(), e, flags); } } // namespace boost #endif // BOOST_REGEX_V5_REGEX_GREP_HPP
[-] match_flags.hpp
[edit]
[-] match_results.hpp
[edit]
[-] syntax_type.hpp
[edit]
[-] regex_match.hpp
[edit]
[-] cpp_regex_traits.hpp
[edit]
[-] iterator_category.hpp
[edit]
[-] error_type.hpp
[edit]
[-] perl_matcher_non_recursive.hpp
[edit]
[-] icu.hpp
[edit]
[-] regex_merge.hpp
[edit]
[-] unicode_iterator.hpp
[edit]
[-] regex_split.hpp
[edit]
[-] regex_grep.hpp
[edit]
[-] pattern_except.hpp
[edit]
[-] u32regex_token_iterator.hpp
[edit]
[-] regex_fwd.hpp
[edit]
[-] basic_regex.hpp
[edit]
[-] perl_matcher.hpp
[edit]
[-] perl_matcher_common.hpp
[edit]
[-] mem_block_cache.hpp
[edit]
[-] regex_iterator.hpp
[edit]
[+]
..
[-] basic_regex_creator.hpp
[edit]
[-] regex_traits_defaults.hpp
[edit]
[-] char_regex_traits.hpp
[edit]
[-] object_cache.hpp
[edit]
[-] regex_search.hpp
[edit]
[-] sub_match.hpp
[edit]
[-] regex_format.hpp
[edit]
[-] c_regex_traits.hpp
[edit]
[-] iterator_traits.hpp
[edit]
[-] regex_replace.hpp
[edit]
[-] regex_raw_buffer.hpp
[edit]
[-] basic_regex_parser.hpp
[edit]
[-] regbase.hpp
[edit]
[-] regex_traits.hpp
[edit]
[-] regex.hpp
[edit]
[-] regex_workaround.hpp
[edit]
[-] regex_token_iterator.hpp
[edit]
[-] states.hpp
[edit]
[-] primary_transform.hpp
[edit]
[-] w32_regex_traits.hpp
[edit]
[-] cregex.hpp
[edit]
[-] u32regex_iterator.hpp
[edit]