/* * * 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_match.hpp * VERSION see * DESCRIPTION: Regular expression matching algorithms. * Note this is an internal header file included * by regex.hpp, do not include on its own. */ #ifndef BOOST_REGEX_MATCH_HPP #define BOOST_REGEX_MATCH_HPP namespace boost{ // // proc regex_match // returns true if the specified regular expression matches // the whole of the input. Fills in what matched in m. // template bool regex_match(BidiIterator first, BidiIterator last, match_results& m, const basic_regex& e, match_flag_type flags = match_default) { BOOST_REGEX_DETAIL_NS::perl_matcher matcher(first, last, m, e, flags, first); return matcher.match(); } template bool regex_match(iterator first, iterator last, const basic_regex& e, match_flag_type flags = match_default) { match_results m; return regex_match(first, last, m, e, flags | regex_constants::match_any); } // // query_match convenience interfaces: // template inline bool regex_match(const charT* str, match_results& m, const basic_regex& e, match_flag_type flags = match_default) { return regex_match(str, str + traits::length(str), m, e, flags); } template inline bool regex_match(const std::basic_string& s, match_results::const_iterator, Allocator>& m, const basic_regex& e, match_flag_type flags = match_default) { return regex_match(s.begin(), s.end(), m, e, flags); } template inline bool regex_match(const charT* str, const basic_regex& e, match_flag_type flags = match_default) { match_results m; return regex_match(str, str + traits::length(str), m, e, flags | regex_constants::match_any); } template inline bool regex_match(const std::basic_string& s, const basic_regex& e, match_flag_type flags = match_default) { typedef typename std::basic_string::const_iterator iterator; match_results m; return regex_match(s.begin(), s.end(), m, e, flags | regex_constants::match_any); } } // namespace boost #endif // BOOST_REGEX_MATCH_HPP