i'm wondering if it's possible to use apply the regex-search algorithm on an input stream. my first thought is that it's not, since i've read (and so it looks on the specification) that the regex_search function can be passed only bi-directional iterators, and as far as i know one can only create input iterators on streams. typically, the first and second arguments of regex_search are iterators on the first and (most annoyingly) last element, which one cannot get with a stream.
however, there might be (and i hope there is) another way to do it i'm not aware of.
Take a look at the partial match examples - there is one that does almost exactly what you want (partial_regex_grep.cpp). John Maddock http://ourworld.compuserve.com/homepages/john_maddock/index.htm