Boost logo

Boost :

From: SourceForge.net (noreply_at_[hidden])
Date: 2003-08-27 07:29:44


Support Requests item #795936, was opened at 2003-08-27 05:29
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=207586&aid=795936&group_id=7586

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: regex_match problem

Initial Comment:
Ruslan Talpa <tristan_at_[hidden]>

I want to match different strings in a whois result and i

am having some problems.

first a execut a shell command similar to:

"/usr/bin/whois domain.com > tmp_file"

so after this we have a file, from wich i read line by line

and try to match some strings but no matter what the

reg. expression is the regex_match returns false.

i even tried "regex expression("a");" and still no luck

The only thing i can think of is that there is some

character encoding stuff envolved but i don't know what

to do. Please help, tell me what i am doin wrong

here are the functions involved

int parse_line(const char* response)

{

   regex expression("a");

   cmatch what;

   if(regex_match(response, what, expression))

   {

      cout << "MATCH\n";

   }

   else

   {

      cout << "NO MATCH\n";

   }

   return 0;

}

int get_info(string domain, char* pipe_file)

{

        string line;

        Message msg;

        strstream command;

        command << "/usr/bin/whois " << domain.c_str()

<< " > " << pipe_file;

        system(command.str());

        ifstream f(pipe_file);

        while (!f.eof())

        {

                getline(f, line);

                parse_line(line.c_str());

        }

        f.close();

        return 0;

}

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=207586&aid=795936&group_id=7586

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Boost-bugs mailing list
Boost-bugs_at_[hidden]
https://lists.sourceforge.net/lists/listinfo/boost-bugs


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk