Boost logo

Boost :

From: Mihaly Zachar (zmihaly_at_[hidden])
Date: 2008-04-10 07:02:48

Hi all,

I'm using libboost-regex1.34.1 from gutsy.

here is a sample for my problem:

------- CUT -------
#include <boost/regex.hpp>
#include <string>
#include <iostream>

using namespace std;
using namespace boost;

int main()
    string input = "1111";
    string a = "(.*)";
    string b = "0$1";

    regex reg (a, regex::perl);

    string out = regex_replace(input, reg, b);

    cout << out << endl;

    return 0;

------- CUT -------

the expected result would be "01111" but it gives "011110"...
why does it work like this ?

if I use anchors (^ and $) it works well, but the problem is I will not
get anchors from the other applications :(

the problem is that I get regexes from different perl and php

will the upgrade to 1.35 solve my problem ?


Boost list run by bdawes at, gregod at, cpdaniel at, john at