2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by missil9
1
#include <boost/regex.hpp>
#include <string>
#include <boost/lexical_cast.hpp>

using namespace std;

double scrape( const std::string& base, const std::string& match )
{
    boost::regex re(match);
    boost::smatch matches;

    // while( boost::regex_search( start, base.end(), matches, re ) )
    if( boost::regex_search( base, matches, re ) )
    {
        std::string value( matches[1].first, matches[1].second );
        return boost::lexical_cast<double>(value) ;
    }
    else return 0.0 ;
}
Votes + Comments
well spotted
0

Thank you very much for the reply. It compiles fine now.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.