Boost logo

Boost :

From: henri.schomaecker_at_[hidden]
Date: 2001-10-18 06:02:55


Hi folks,

I`m used to work in perl or other scripting languages and now
switched to c++ so please mention, I`m no pro in c++.

First of all: Thanks for this nice library; with the freeodbc++ lib
I`m now able to port my perl-CMS to an Apache Module for every
platform, which is great and extremely fast. I love it!

I want to port my perl page-template-includer which includes variable-
 and function-values into html-pages.

My problem is, that I didn`t understand, how I can rely on the actual
found value. Yes, Iread the docs and examples, but because I`m not
that experienced in c++ right now, It`s still very difficult for me
to find out how that`s done by the source of the examples.

Lets say, I could get the last name with Session.getValue(last_name).

This is my very simple example as far as I´m now:
8<---------8<---------8<---------8<---------8<---------8<---------
std::string _template("Hello Mr. ###var=last_name###");

std::string repl("Schomäcker");
std::string tmpstr;
std::string mysource(_template);
boost::regex myregex("###var=([^#]*)###");
        
const char *replaced = (tmpstr = boost::regex_merge(mysource,
        myregex, repl)).c_str();
8<---------8<---------8<---------8<---------8<---------8<---------

what I now would like to do is something, I would write like this in
perl (I know, this is not correct now because I mix both languages,
It`s just for the understanding):

const char *replaced = (tmpstr = boost::regex_merge(mysource,
        myregex, Session.getValue($1))).c_str();

How is this done in c++ with the regex-lib?

Many thanks in advance,
yours Henri


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk