I want to use regex_replace to operate on a potentially large input file and output the results to another file. So, I can't load the entire file into a buffer in memory and pass it in as is done in the examples. I can't seem to figure out how to pass fstream or some other file I/O into regex_replace (ie create the proper iterator).
Take a look at the second example in http://www.boost.org/libs/regex/doc/partial_matches.html Unfortunately if you want to do a search and replace in an "infinite" text, then you're not going to be able to use regex_replace. Instead you'll have to enumerate through the matches and copy unmatched sections to output, and then call match_results::format on matched sections to get the text to output for that section. HTH, John.