Boost C++ Libraries: Ticket #13634: regex duplicating literal part of replace string https://svn.boost.org/trac10/ticket/13634 <p> The below code should result in 'moreless' but instead results in 'morelessless' </p> <pre class="wiki">#include &lt;iostream&gt; #include &lt;string&gt; #include &lt;boost/regex.hpp&gt; int main(int argc, char **argv) { boost::regex::flag_type regex_flags = boost::regex_constants::normal; boost::regex_constants::match_flag_type match_flags = boost::regex_constants::match_default; boost::regex pattern("(.*)", regex_flags); std::string strResult; strResult = boost::regex_replace(std::string("more"), pattern, std::string("${1}less"), match_flags); std::cout &lt;&lt; strResult &lt;&lt; std::endl; char result; std::cin &gt;&gt; result; return 0; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13634 Trac 1.4.3