1 // Boost string_algo library regex_find_format.hpp header file ---------------------------//
3 // Copyright Pavol Droba 2002-2003.
5 // Distributed under the Boost Software License, Version 1.0.
6 // (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 // See http://www.boost.org/ for updates, documentation, and revision history.
11 #ifndef BOOST_STRING_REGEX_FIND_FORMAT_HPP
12 #define BOOST_STRING_REGEX_FIND_FORMAT_HPP
14 #include <boost/algorithm/string/config.hpp>
15 #include <boost/regex.hpp>
16 #include <boost/algorithm/string/detail/finder_regex.hpp>
17 #include <boost/algorithm/string/detail/formatter_regex.hpp>
20 Defines the \c regex_finder and \c regex_formatter generators. These two functors
21 are designed to work together. \c regex_formatter uses additional information
22 about a match contained in the regex_finder search result.
28 // regex_finder -----------------------------------------------//
32 Construct the \c regex_finder. Finder uses the regex engine to search
34 Result is given in \c regex_search_result. This is an extension
35 of the iterator_range. In addition it contains match results
36 from the \c regex_search algorithm.
38 \param Rx A regular expression
39 \param MatchFlags Regex search options
40 \return An instance of the \c regex_finder object
44 typename RegexTraitsT>
45 inline detail::find_regexF< basic_regex<CharT, RegexTraitsT> >
47 const basic_regex<CharT, RegexTraitsT>& Rx,
48 match_flag_type MatchFlags=match_default )
52 basic_regex<CharT, RegexTraitsT> >( Rx, MatchFlags );
55 // regex_formater ---------------------------------------------//
59 Construct the \c regex_formatter. Regex formatter uses the regex engine to
60 format a match found by the \c regex_finder.
61 This formatted it designed to closely cooperate with \c regex_finder.
63 \param Format Regex format definition
64 \param Flags Format flags
65 \return An instance of the \c regex_formatter functor
69 typename TraitsT, typename AllocT >
70 inline detail::regex_formatF< std::basic_string< CharT, TraitsT, AllocT > >
72 const std::basic_string<CharT, TraitsT, AllocT>& Format,
73 match_flag_type Flags=format_default )
76 detail::regex_formatF< std::basic_string<CharT, TraitsT, AllocT> >(
81 } // namespace algorithm
83 // pull the names to the boost namespace
84 using algorithm::regex_finder;
85 using algorithm::regex_formatter;
90 #endif // BOOST_STRING_REGEX_FIND_FORMAT_HPP