Opened 4 years ago

#13535 new Bugs

xpressive miss captured groups name while assign a match_results object to another.

Reported by: hyd <ruoleng@…> Owned by: Eric Niebler
Milestone: To Be Determined Component: xpressive
Version: Boost 1.67.0 Severity: Problem
Keywords: xpressive captured groups Cc:

Description

example:

cmatch  match;

cmatch  mat2;

cregex rex = tcompile("(?P<ErrorCode>\\d{5})");

if( regex_match("error10205",match,rex) )
{

	mat2 = match;

	string strErr = mat["ErrorCode"];  //  Here will not get the match string

}

It's cause by funciton: void swap(match_results<BidiIter> &that)

in match_results.hpp file.

I had fix the bug, by adding

this->named_marks_.swap(that.named_marks_);

after line 668.

Change History (0)

Note: See TracTickets for help on using tickets.