Welcome to Deadbeef.com
Articles and tips on software from authored by Jeremy Bettis.

Search

XML Feed RSS

What is RSS?

Who's Online?

  • Guest Users: 8

Archives for: July 2008

07/03/08

Permalink 11:42:12 am, by Jeremy Email , 72 words, 750 views   English (US)
Categories: Programming, C++

Boost::regex tip of the day

If you use boost::regex, don't do what I just did.

  1. Calling boost::regex_match(std::string&,match_results&,basic_regex&)

  2. Changing the std::string that was passed to regex_match.

  3. Trying to look at the sub-matches in the match_results object.

I didn't realize that match_results kept references to the string, and so you can't edit the string.

Perhaps that will save someone from hitting an assert().

July 2008
Sun Mon Tue Wed Thu Fri Sat
 << < Current> >>
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

Categories

powered by
b2evolution