Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C++
Boost sanity check
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Evan Carew, post: 1517948"] -----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 - [URL]http://enigmail.mozdev.org[/URL] iD8DBQFBiYCmoo/Prlj9GScRAjliAJkB73tdtu25P4jH8pHnlMgFSLy6/ACbB4oQ TjsAidUXHcEQpeNtsVu9M1Y= =i/F0 -----END PGP SIGNATURE----- [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
Boost sanity check
Top