Hi,
Thanks for answering the question. That shows that that is not bug in
boost::regex. But I have one more thing to ask. Ofcourse when the
dependancy on external file is removed boost::regex is working fine. When
you ran the code with the string directly from the file, did your regex pick
the second one ? You can certainly think that this is a question not to be
answered by a busy person like you. You might choose to ignore this
question. But if you can, please answer this. Also please tell me which
version of boost library are you using? I am running the code in a linux
machine and the code i already sent is not picking the second one.
Thanks
Kiran.
----- Original Message -----
From: "John Maddock"
kiran wrote:
Why is the second one not picked ? This was my question.
It is picked for me: I modified your sample program (see below) so that it actually compiled, and didn't reply on external files, and I see exactly the output expected: everything from the first "Resurfacing" to the last "home".
#include "boost/regex.hpp" using namespace boost; using namespace std; #include
#include #include <iostream> int main() { char buf[10000]; //int fd = open("glass.htm", O_RDONLY); //int size = read(fd, buf, 10000); string line = "<!-- saved from url=(0022)http://internet.e-mail -->\n" "<html><head>\n" "<title>UGlassIt Fibre-Shelkote Pool Resurfacing for Swimming Pools</title>\n" "Home\n" "Home"; //close(fd); regex expr("Resurfacing(.|\n)*Home" , boost::regex::icase | boost::regex::perl); try { sregex_iterator itr(line.begin(), line.end(), expr, boost::match_not_dot_newline); sregex_iterator i; while(itr != i) { cout<
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users