Hi,

I have a string withš 2 Cyrillicš words ÎÏ×ÙÊ ÄÏÍ repeated 3 times.

I try to regex_replace šeach occurrance ofšthese words. š

For this I šuse šstd:: string format("$1 ËÒÁÓÎÙÊ $2")

and regexš pattern ("(\\W+)\\s+(\\W+)"),


The result is only the last occurrence is replaced,the 2 preceding ones are not.

Where is my mistake?

My code:


#include <iostream>

#include <string>

#include "boost/regex.hpp"

using namespace std;


int main(int argc, const char** argv)

{

std::string str( "ÎÏ×ÙÊ ÄÏÍ, ÎÏ×ÙÊ ÄÏÍ ÎÏ×ÙÊ ÄÏÍ" );

regex regx("(\\W+)\\s+(\\W+)");

šš std::string format( "$1 ËÒÁÓÎÙÊ $2");

cout<<"regex_replace :"<<regex_replace( str, regx, format );

šreturn 0;

}



I use iMac Intel Core Duo, Mac OSX 10.6.8,š

IDE - Xcode 3.2.6


Thank you.

egersheldster