Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 22nd, 2008, 6:23 PM   #1
Soulstorm
Hobbyist Programmer
 
Soulstorm's Avatar
 
Join Date: Jan 2006
Location: Menidi, Athens, Greece
Posts: 239
Rep Power: 3 Soulstorm is on a distinguished road
C++ cross-platform Regular Expression Library

I am building something that seems to be an IRC chat client...

I have managed to do all connections and send and receive text from the server. However, the difficult part is to actually process the received messages.

I figured out I need regular expressions for this, only I don't know how to implement them! Installing Boost (which has regular expressions) is a pain in the butt for OS X, so can anyone provide me with a cross-platform regular expression Library?

I am using OS X, so Windows specific answers will not help.
__________________
Project::Soulstorm (personal homepage)
Soulstorm is offline   Reply With Quote
Old Mar 22nd, 2008, 8:29 PM   #2
Ancient Dragon
PFO God In Training
 
Ancient Dragon's Avatar
 
Join Date: Jun 2005
Location: near St Louis, MO. (USA)
Posts: 532
Rep Power: 4 Ancient Dragon is on a distinguished road
Re: C++ cross-platform Regular Expression Library

use boost Regular Expressions, but I don't know if it supports your os or not. Probably does because it can be compiled for both *nix and MS-Windows. Read all about boost libraries here.
__________________
I Like Ike. Vote for Dwight Eisenhower this November.
--This message brought to you by the the Procrastinators Club Of America.
Ancient Dragon is offline   Reply With Quote
Old Mar 22nd, 2008, 9:17 PM   #3
The Dark
Expert Programmer
 
Join Date: Jun 2005
Posts: 825
Rep Power: 4 The Dark is on a distinguished road
Re: C++ cross-platform Regular Expression Library

I can recommend PCRE.
The Dark is offline   Reply With Quote
Old Mar 23rd, 2008, 3:19 AM   #4
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Re: C++ cross-platform Regular Expression Library

Installing Boost is easy with MacPorts.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Mar 23rd, 2008, 7:10 AM   #5
Soulstorm
Hobbyist Programmer
 
Soulstorm's Avatar
 
Join Date: Jan 2006
Location: Menidi, Athens, Greece
Posts: 239
Rep Power: 3 Soulstorm is on a distinguished road
Re: C++ cross-platform Regular Expression Library

I don't want to use boost. It is a pain in the butt to install. And Ooble's recommendation was nice, but it didn't work for me, because for some reason, because the script fails to install the .profile file inside my user directory. So, I can't install anything.

Quote:
Originally Posted by The Dark View Post
I can recommend PCRE.
Thanks! At least that was installed. How can I find a tutorial or any documentation on how to use this library with C++? What headers do I need to include?
__________________
Project::Soulstorm (personal homepage)
Soulstorm is offline   Reply With Quote
Old Mar 23rd, 2008, 7:29 AM   #6
The Dark
Expert Programmer
 
Join Date: Jun 2005
Posts: 825
Rep Power: 4 The Dark is on a distinguished road
Re: C++ cross-platform Regular Expression Library

Have a look at the pcrecpp.h file - it should be in the pcre directory. It is a wrapper for use with c++. This makes it a lot easier to use the library. There is a lot of instructions and examples in the .h file.
The Dark is offline   Reply With Quote
Old Mar 23rd, 2008, 10:16 AM   #7
Soulstorm
Hobbyist Programmer
 
Soulstorm's Avatar
 
Join Date: Jan 2006
Location: Menidi, Athens, Greece
Posts: 239
Rep Power: 3 Soulstorm is on a distinguished road
Re: C++ cross-platform Regular Expression Library

Quote:
Originally Posted by The Dark View Post
Have a look at the pcrecpp.h file - it should be in the pcre directory. It is a wrapper for use with c++. This makes it a lot easier to use the library. There is a lot of instructions and examples in the .h file.
I am using OS X. Could you be more specific? If you are using windows, where do you find those files on windows? It may help me with this...
__________________
Project::Soulstorm (personal homepage)
Soulstorm is offline   Reply With Quote
Old Mar 23rd, 2008, 10:49 AM   #8
The Dark
Expert Programmer
 
Join Date: Jun 2005
Posts: 825
Rep Power: 4 The Dark is on a distinguished road
Re: C++ cross-platform Regular Expression Library

They were in the base of the library. Probably the best thing to do would be to download the zip file from the site and use the source code that comes with it. It should compile OK on OS X (I think a friend of mine has tried it).
The Dark is offline   Reply With Quote
Old Mar 27th, 2008, 3:53 AM   #9
Soulstorm
Hobbyist Programmer
 
Soulstorm's Avatar
 
Join Date: Jan 2006
Location: Menidi, Athens, Greece
Posts: 239
Rep Power: 3 Soulstorm is on a distinguished road
Re: C++ cross-platform Regular Expression Library

What do you mean by that? To just throw the folder into my project and just type "include "pcre.h""?

Actually, I am trying to do this, but it always complain about files it can't find!
__________________
Project::Soulstorm (personal homepage)
Soulstorm is offline   Reply With Quote
Old Mar 27th, 2008, 7:56 AM   #10
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Re: C++ cross-platform Regular Expression Library

What complaints do you get? Are they compiler errors or linker errors?
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Regular Expression: Matching All Possible Characters kruptof PHP 3 May 30th, 2007 6:22 PM
Date Regular Expression King C# 2 Apr 30th, 2006 9:41 PM
Word Frequency Regular Expression hoffmandirt C# 4 Feb 27th, 2006 8:21 PM
Regular Expression toghian C++ 12 Dec 28th, 2005 10:12 PM
Regular Expression HELP -- thanks paulchwd JavaScript and Client-Side Browser Scripting 3 Oct 11th, 2005 4:40 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:18 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC