/* * * 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_search.hpp * VERSION see * DESCRIPTION: Provides regex_search implementation. */ #ifndef BOOST_REGEX_V5_REGEX_SEARCH_HPP #define BOOST_REGEX_V5_REGEX_SEARCH_HPP namespace boost{ template bool regex_search(BidiIterator first, BidiIterator last, match_results& m, const basic_regex& e, match_flag_type flags = match_default) { return regex_search(first, last, m, e, flags, first); } template bool regex_search(BidiIterator first, BidiIterator last, match_results& m, const basic_regex& e, match_flag_type flags, BidiIterator base) { if(e.flags() & regex_constants::failbit) return false; BOOST_REGEX_DETAIL_NS::perl_matcher matcher(first, last, m, e, flags, base); return matcher.find(); } // // regex_search convenience interfaces: // template inline bool regex_search(const charT* str, match_results& m, const basic_regex& e, match_flag_type flags = match_default) { return regex_search(str, str + traits::length(str), m, e, flags); } template inline bool regex_search(const std::basic_string& s, match_results::const_iterator, Allocator>& m, const basic_regex& e, match_flag_type flags = match_default) { return regex_search(s.begin(), s.end(), m, e, flags); } template bool regex_search(BidiIterator first, BidiIterator last, const basic_regex& e, match_flag_type flags = match_default) { if(e.flags() & regex_constants::failbit) return false; match_results m; typedef typename match_results::allocator_type match_alloc_type; BOOST_REGEX_DETAIL_NS::perl_matcher matcher(first, last, m, e, flags | regex_constants::match_any, first); return matcher.find(); } template inline bool regex_search(const charT* str, const basic_regex& e, match_flag_type flags = match_default) { return regex_search(str, str + traits::length(str), e, flags); } template inline bool regex_search(const std::basic_string& s, const basic_regex& e, match_flag_type flags = match_default) { return regex_search(s.begin(), s.end(), e, flags); } } // namespace boost #endif // BOOST_REGEX_V5_REGEX_SEARCH_HPP