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: 12

Boost::regex tip of the day

07/03/08

Permalink 11:42:12 am, by Jeremy Email , 72 words, 312 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().

Comments, Pingbacks:

No Comments/Pingbacks for this post yet...

Leave a comment:

Your email address will not be displayed on this site.
Your URL will be displayed.

Allowed XHTML tags: <p, ul, ol, li, dl, dt, dd, address, blockquote, ins, del, span, bdo, br, em, strong, dfn, code, samp, kdb, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small>
(Line breaks become <br />)
(Set cookies for name, email and url)
(Allow users to contact you through a message form (your email will NOT be displayed.))

January 2009
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
        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