473,503 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Regex library

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!
Nov 17 '05 #1
7 1405

"Beeeeeeeeeeeeves" <Be**************@discussions.microsoft.com> wrote in
message news:E1**********************************@microsof t.com...
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
Nov 17 '05 #2
>
"Beeeeeeeeeeeeves" <Be**************@discussions.microsoft.com> wrote in
message news:E1**********************************@microsof t.com...
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


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
Nov 17 '05 #3
> see http://www.boost.org/libs/regex/doc/index.html

Exactly! One the main reasons I could not convince myself to move to C# from
C++, was the BOOST libraries. It seems I can't understand how people manage
to program anythign in C# or Java without BOOST, Blitz and Loki.
Nov 17 '05 #4
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?
Nov 17 '05 #5
"Beeeeeeeeeves" <Be***********@discussions.microsoft.com> wrote in message
news:20**********************************@microsof t.com...
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
Nov 17 '05 #6
Beeeeeeeeeeeeves wrote:
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
Nov 17 '05 #7

"Beeeeeeeeeves" <Be***********@discussions.microsoft.com> wrote in message
news:20**********************************@microsof t.com...
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

Nov 17 '05 #8

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

Similar topics

3
2060
by: Jon Maz | last post by:
Hi All, Am getting frustrated trying to port the following (pretty simple) function to CSharp. The problem is that I'm lousy at Regular Expressions.... //from...
2
3700
by: Richard Latter | last post by:
Hello All, I am a newbie to the Boost library and I have a question about a simple function. All I would like to do is to create a simple function that can test strings using regular...
4
9700
by: aevans1108 | last post by:
expanding this message to microsoft.public.dotnet.xml Greetings Please direct me to the right group if this is an inappropriate place to post this question. Thanks. I want to format a...
7
5712
by: alphatan | last post by:
Is there relative source or document for this purpose? I've searched the index of "Mastering Regular Expression", but cannot get the useful information for C. Thanks in advanced. -- Learning...
9
4564
by: Tim Conner | last post by:
Is there a way to write a faster function ? public static bool IsNumber( char Value ) { if (Regex.IsMatch( Value.ToString(), @"^+$" )) { return true; } else return false; }
7
2594
by: bill tie | last post by:
I'd appreciate it if you could advise. 1. How do I replace "\" (backslash) with anything? 2. Suppose I want to replace (a) every occurrence of characters "a", "b", "c", "d" with "x", (b)...
6
8814
by: Chris Anderson | last post by:
Anyone know of a fix (ideally) or an easy workaround to the problem of escape characters not working in regex replacement text? They just come out as literal text For example, you'd think that thi...
7
2219
by: Mike Labosh | last post by:
I have the following System.Text.RegularExpressions.Regex that is supposed to remove this predefined list of garbage characters from contact names that come in on import files : Dim...
9
2070
by: jmchadha | last post by:
I have got the following html: "something in html ... etc.. city1... etc... <a class="font1" href="city1.html" onclick="etc."click for <b>info</bon city1 </a> ... some html. city1.. can repeat...
4
4386
by: DSmith1974 | last post by:
Are lookarounds supported in the boost regex lib? In my VS6 project using boost 1.32.0 I can declare a regex as.. <code_snippet> std::wstring wstrFilename = L"01_BAR08"; boost::wregex...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7008
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5022
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4688
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3177
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3168
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
746
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.