[Boost-bugs] [Boost C++ Libraries] #13634: regex duplicating literal part of replace string

Subject: [Boost-bugs] [Boost C++ Libraries] #13634: regex duplicating literal part of replace string
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2018-07-13 14:29:28


#13634: regex duplicating literal part of replace string
------------------------------+--------------------------
 Reporter: joseph@… | Owner: John Maddock
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: regex
  Version: Boost 1.67.0 | Severity: Problem
 Keywords: |
------------------------------+--------------------------
 The below code should result in 'moreless' but instead results in
 'morelessless'

 {{{
 #include <iostream>
 #include <string>
 #include <boost/regex.hpp>

 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 << strResult << std::endl;
   char result;
   std::cin >> result;
   return 0;
 }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac10/ticket/13634>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2018-07-13 14:36:02 UTC