分类: C/C++
2011-08-04 10:29:53
#include <vector>
#include <tpl/RegExp.h>
using namespace tpl; // What we use:
// * Rules: /assign(), %, real(), ws()
// * Matching: tpl::simple::match()
void simplest(){
std::vector<double> values; // you can change vector to other stl containers.
if (simple::match( "-.1 -0.1 +32. -22323.2e+12", real()/assign(values) % ws()) ) {
for ( std::vector<double>::iterator it = values.begin(); it != values.end(); ++it) {
std::cout << *it << "\n";
}
}
}