Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:08:38

0001 /*
0002  *
0003  * Copyright (c) 1998-2002
0004  * John Maddock
0005  *
0006  * Use, modification and distribution are subject to the 
0007  * Boost Software License, Version 1.0. (See accompanying file 
0008  * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0009  *
0010  */
0011 
0012  /*
0013   *   LOCATION:    see http://www.boost.org for most recent version.
0014   *   FILE         regex_match.hpp
0015   *   VERSION      see <boost/version.hpp>
0016   *   DESCRIPTION: Regular expression matching algorithms.
0017   *                Note this is an internal header file included
0018   *                by regex.hpp, do not include on its own.
0019   */
0020 
0021 
0022 #ifndef BOOST_REGEX_MATCH_HPP
0023 #define BOOST_REGEX_MATCH_HPP
0024 
0025 namespace boost{
0026 
0027 //
0028 // proc regex_match
0029 // returns true if the specified regular expression matches
0030 // the whole of the input.  Fills in what matched in m.
0031 //
0032 template <class BidiIterator, class Allocator, class charT, class traits>
0033 bool regex_match(BidiIterator first, BidiIterator last, 
0034                  match_results<BidiIterator, Allocator>& m, 
0035                  const basic_regex<charT, traits>& e, 
0036                  match_flag_type flags = match_default)
0037 {
0038    BOOST_REGEX_DETAIL_NS::perl_matcher<BidiIterator, Allocator, traits> matcher(first, last, m, e, flags, first);
0039    return matcher.match();
0040 }
0041 template <class iterator, class charT, class traits>
0042 bool regex_match(iterator first, iterator last, 
0043                  const basic_regex<charT, traits>& e, 
0044                  match_flag_type flags = match_default)
0045 {
0046    match_results<iterator> m;
0047    return regex_match(first, last, m, e, flags | regex_constants::match_any);
0048 }
0049 //
0050 // query_match convenience interfaces:
0051 //
0052 template <class charT, class Allocator, class traits>
0053 inline bool regex_match(const charT* str, 
0054                         match_results<const charT*, Allocator>& m, 
0055                         const basic_regex<charT, traits>& e, 
0056                         match_flag_type flags = match_default)
0057 {
0058    return regex_match(str, str + traits::length(str), m, e, flags);
0059 }
0060 
0061 template <class ST, class SA, class Allocator, class charT, class traits>
0062 inline bool regex_match(const std::basic_string<charT, ST, SA>& s, 
0063                  match_results<typename std::basic_string<charT, ST, SA>::const_iterator, Allocator>& m, 
0064                  const basic_regex<charT, traits>& e, 
0065                  match_flag_type flags = match_default)
0066 {
0067    return regex_match(s.begin(), s.end(), m, e, flags);
0068 }
0069 template <class charT, class traits>
0070 inline bool regex_match(const charT* str, 
0071                         const basic_regex<charT, traits>& e, 
0072                         match_flag_type flags = match_default)
0073 {
0074    match_results<const charT*> m;
0075    return regex_match(str, str + traits::length(str), m, e, flags | regex_constants::match_any);
0076 }
0077 
0078 template <class ST, class SA, class charT, class traits>
0079 inline bool regex_match(const std::basic_string<charT, ST, SA>& s, 
0080                  const basic_regex<charT, traits>& e, 
0081                  match_flag_type flags = match_default)
0082 {
0083    typedef typename std::basic_string<charT, ST, SA>::const_iterator iterator;
0084    match_results<iterator> m;
0085    return regex_match(s.begin(), s.end(), m, e, flags | regex_constants::match_any);
0086 }
0087 
0088 
0089 } // namespace boost
0090 
0091 #endif   // BOOST_REGEX_MATCH_HPP
0092