473,324 Members | 2,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Boost sanity check

-----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-----
Jul 22 '05 #1
0 870

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Fred Ma | last post by:
Hello, I posted previously under the thread: How to break this up into streambuf/ostream I've asked our library to get "C++ IOStreams and Locales..." by A. Langer et al. Meantime, I've...
2
by: Jonathan Pryor | last post by:
I'm in need of a sanity check: is the following code valid C++? namespace foo { class NamespaceClass { }; } using namespace foo; class Bug_GlobalFriendDeclaresNamespaceClass {
3
by: g | last post by:
hello! here is some code: #ifndef RESOURCE_H_ #define RESOURCE_H_ #include <boost/date_time/gregorian/gregorian.hpp> #include <boost/thread/mutex.hpp>
34
by: Guch Wu | last post by:
Boost has many terrific libraries. But I want to know whether they are ready for using in real projects. Which of them are mature enough, or just only in progress?
6
by: Dan Henry | last post by:
I need a sanity check. The following is an exchange on comp.arch.embedded with CBFalconer in a rather long MISRA related thread. Since my little section of that thread and area of interest was...
2
by: andrew_nuss | last post by:
Hi, I have an Array<Ttemplate that specializes on T's in my program that inherit from a base class that I've defined called CtorDtorLess. In my array template, I check if...
3
by: Barry | last post by:
As boost::pool_alloc use singleton holder for pool allocator, client programmers have to reclaim the memory by hand through calling singleton_pool<alloc_tag, elem_size>::purge_memory() or something...
0
by: cypher_key | last post by:
I'm C# and would like to get a sanity check from the group to ensure that I'm going down the right road. The first form in my mini-application is a search screen. I have an image of it here:...
3
by: stevewilliams2004 | last post by:
I am attempting to create a singleton, and was wondering if someone could give me a sanity check on the design - does it accomplish my constraints, and/or am I over complicating things. My design...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.