Regex library

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
I do mostly programming in VB6 and C# although I like to dabble in C++ now and again, I was just wondering what is a good* regular expression library to use for C++, given that I DON'T want to use managed C++.

* I define "good" in this case as conforming to the following priorities, in order:
1- Easy to install, reference and use. I don't want loads of header file confusion before I've even started
2- Standardised/conformant (i.e. NOT gnu-based)
3- Fast


Thanks!
 
Beeeeeeeeeeeeves said:
Hi
I do mostly programming in VB6 and C# although I like to dabble in C++ now
and again, I was just wondering what is a good* regular expression library
to use for C++, given that I DON'T want to use managed C++.
* I define "good" in this case as conforming to the following priorities, in order:
1- Easy to install, reference and use. I don't want loads of header file
confusion before I've even started
2- Standardised/conformant (i.e. NOT gnu-based)
3- Fast

see http://www.boost.org/libs/regex/doc/index.html

Jeff F
 
now
and again, I was just wondering what is a good* regular expression library
to use for C++, given that I DON'T want to use managed C++. priorities,
in order:
confusion before I've even started

see http://www.boost.org/libs/regex/doc/index.html

Jeff F

I agree, the Boost libraries are great for lots of reasons including regexs.
Especially check out their smart pointer classes (in particular
shared_ptr) - they make C++ much easier and safer. Plus it's all free! :-)

Steve
 
Thanks
It looks alright, but I don't know whether I've downloaded the right thing.
I've got about 7 .hpp files, totalling 190KB when unpacked.... is that it?
Or do I have to download something else and build it?

If it's the case that those 7 .hpp files is all I need, which of them do I #include, or do I #include them all?
 
Beeeeeeeeeves said:
Thanks
It looks alright, but I don't know whether I've downloaded the right thing.
I've got about 7 .hpp files, totalling 190KB when unpacked.... is that it?
Or do I have to download something else and build it?

If it's the case that those 7 .hpp files is all I need, which of them do I
#include, or do I #include them all?

Hi,

7 might be it for the regex part of it, but you'd be well advised to
download the whole Boost library. The regex stuff is slightly harder to get
going than the rest of the library - read the docs properly. The file you
need to include is boost/regex.hpp.

I haven't set it up for ages, but there are two options; either you can
build the regex lib and link against it, or you can define
BOOST_REGEX_NO_LIB, and include the CPPs it requires in your project. Read
the documentation though.

Steve
 
Beeeeeeeeeeeeves said:
Hi
I do mostly programming in VB6 and C# although I like to dabble in
C++ now and again, I was just wondering what is a good* regular
expression library to use for C++, given that I DON'T want to use
managed C++.

* I define "good" in this case as conforming to the following
priorities, in order: 1- Easy to install, reference and use. I don't
want loads of header file confusion before I've even started 2-
Standardised/conformant (i.e. NOT gnu-based) 3- Fast

As others have said, boost::regex is a fine library - I've used it many
times.

You might also want to check out GRETA from Microsoft Research. The
original page for it is here:

http://research.microsoft.com/projects/greta/

and you can get a version with more pleasing license terms here:

http://www.gotdotnet.com/team/cplusplus/ (it's in the VC++ PowerTools)

Note that regular expressions will be included in the upcoming Library
Technical Report that the ISO C++ Committee is working on. The interface
that's defined by TR1 is much closer to that of boost::regex than it is to
GRETA. The authors of GRETA and boost::regex both contributed to the design
of the TR1 version of regex, which should eventually become part of the next
version of the C++ standard.

-cd
 
Beeeeeeeeeves said:
Thanks
It looks alright, but I don't know whether I've downloaded the right thing.
I've got about 7 .hpp files, totalling 190KB when unpacked.... is that it?
Or do I have to download something else and build it?

If it's the case that those 7 .hpp files is all I need, which of them do I
#include, or do I #include them all?

Probably not boost_1_31_0.zip is 13MB. Yes you'll need to build the regex
library. Follow the directions on www.boost.org getting started.

You probably only downloaded some patched headers, not the complete boost
library.

Jeff F
 
Back
Top