31 Jul
2009
31 Jul
'09
1:08 p.m.
Pascal Kesseli wrote: Sent: Friday, July 31, 2009 6:40 AM
However, changing line 18 to: if(regex_match(lexical_cast<string>(match[2]), match,
REPORT_DATA_ITEM)) {
and thus eliminating the temporary variable tmp, results in the
following
output:
kW kvar 1090618220000 0008 15 1: (1.5.0)(kW)(5.5.0)(kvar)(8.5.0)(kvar) 1: 1:
What might be the problem here? Am I misusing the match_results class in some way?
Thanks for any help and best regards Pascal
match_results stores iterators into the original string. The string returned from lexical_cast goes out of scope as soon as regex_match returns, therefore invalidating the iterators in match_results. HTH Andrew