Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

Click here to view the latest version of this page.
PrevUpHomeNext

Function regex_match

boost::xpressive::regex_match — See if a regex matches a sequence from beginning to end.

Synopsis

template<typename OtherBidiIter, typename BidiIter> 
bool regex_match(OtherBidiIter begin, OtherBidiIter end, 
match_results< BidiIter > & what, 
basic_regex< BidiIter > const & re, 
regex_constants::match_flag_type flags = regex_constants::match_default);
template<typename OtherBidiIter, typename BidiIter> 
bool regex_match(OtherBidiIter begin, OtherBidiIter end, 
basic_regex< BidiIter > const & re, 
regex_constants::match_flag_type flags = regex_constants::match_default);
template<typename Char> 
bool regex_match(Char const * begin, match_results< Char const * > & what, 
basic_regex< Char const * > const & re, 
regex_constants::match_flag_type flags = regex_constants::match_default);
template<typename Char, typename Traits, typename Alloc> 
bool regex_match(std::basic_string< Char, Traits, Alloc > const & str, 
match_results< typename std::basic_string< Char, Traits, Alloc >::const_iterator > & what, 
basic_regex< typename std::basic_string< Char, Traits, Alloc >::const_iterator > const & re, 
regex_constants::match_flag_type flags = regex_constants::match_default);
template<typename Char> 
bool regex_match(Char const * begin, basic_regex< Char const * > const & re, 
regex_constants::match_flag_type flags = regex_constants::match_default);
template<typename Char, typename Traits, typename Alloc> 
bool regex_match(std::basic_string< Char, Traits, Alloc > const & str, 
basic_regex< typename std::basic_string< Char, Traits, Alloc >::const_iterator > const & re, 
regex_constants::match_flag_type flags = regex_constants::match_default);

Description

Determines whether there is an exact match between the regular expression re, and all of the sequence [begin, end).

Parameters:
begin

The beginning of the sequence.

end

The end of the sequence.

flags

Optional match flags, used to control how the expression is matched against the sequence. (See match_flag_type.)

re

The regular expression object to use

what

The match_results struct into which the sub_matches will be written

Requires:

Types BidiIter and OtherBidiIter meet the requirements of a Bidirectional Iterator (24.1.4).

OtherBidiIter is convertible to BidiIter.

[begin,end) denotes a valid iterator range.

Returns:

true if a match is found, false otherwise

Throws: regex_error on stack exhaustion
Copyright 2003, 2004 Eric Niebler

PrevUpHomeNext