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-----
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-----