Boost sanity check

E

Evan Carew

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ok, I can't seem to get the following regex code to work & I don't know
why. The program compiles and runs, but I can't seem to get it to match
on anything in the test string. Doe anybody know what I am doing wrong?

TIA
Evan

#include <boost/regex.hpp>
#include <fstream>

typedef std::string::iterator Iterator;

std::string getHeaderName(string &mystring){
string hname;
boost::regex Header_Name("[[:word:]]+:");
boost::smatch m;
regex_match(mystring.c_str(), m, Header_Name);
cout << "Header Name = " << m.str() << endl;
return hname;
}


int main(){
string str("Xref: kiwi.ora.com news.software.b:1234 news.binaries:3456");
getHeaderName(str);
}
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFBiYCmoo/Prlj9GScRAjliAJkB73tdtu25P4jH8pHnlMgFSLy6/ACbB4oQ
TjsAidUXHcEQpeNtsVu9M1Y=
=i/F0
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top