LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 09-29-2003, 08:07 AM   #1
lumux
LQ Newbie
 
Registered: Aug 2003
Posts: 17

Rep: Reputation: 0
GNU C++ Regex


HELP!

Can anyone help me? I am relatively new to C++ programming on Linux and I need to know the easiest way to use Regular Expressions.

If anyone can help me and possibley supply some examples, that would be great

Cheers

Lumux
 
Old 09-29-2003, 10:27 AM   #2
UltimaGuy
Member
 
Registered: Aug 2003
Location: Chennai, India
Distribution: PCLinuxOS .92, FC4
Posts: 840

Rep: Reputation: 30
I think that you better look into perl or python if you have to work exclusively on regular expressions. As for C++, you can look for bruce eckel's book Thinking in C++ in www.mindview.net for some info, if I remember correctly.
 
Old 09-29-2003, 10:43 AM   #3
lumux
LQ Newbie
 
Registered: Aug 2003
Posts: 17

Original Poster
Rep: Reputation: 0
Nah, that too easy, I canm allready code Perl, Python, PHP and JAVA.....just need C++

thanks for the links though....haven't found any references to Regex yet but will keep looking
 
Old 09-29-2003, 01:52 PM   #4
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: ubuntu
Posts: 2,524

Rep: Reputation: 93
I would not know if there were standard classes for C++ for handling regular expressions, but for C there are. As you probably know, you can use C-functions in C++ without problems.

In C you need too "compile" a regexp using the function regcomp().
The "compiled" regexp can then be used to match strings with regexec().

See:
$ info -f libc "regular expressions"
and/or:
$ man regcomp
$ man regexec

Last edited by Hko; 09-29-2003 at 01:53 PM.
 
Old 09-29-2003, 03:20 PM   #5
nakkaya
Guru
 
Registered: Jan 2003
Location: Turkey&USA
Distribution: Emacs and linux is its device driver(Slackware,redhat)
Posts: 1,398

Rep: Reputation: 45
there are couple of regular expression libs.
http://ourworld.compuserve.com/homep...ck/regexpp.htm
and there is one from gnu software check their page but as usual it is written in c not c++ but you can still use it
 
Old 09-29-2003, 10:51 PM   #6
lyle_s
Member
 
Registered: Jul 2003
Distribution: Slackware
Posts: 362

Rep: Reputation: 44
The C++ Boost library has a regex stuff. Have a look at http://www.boost.org/libs/regex/index.htm.

C++ Boost is a good thing to be familiar with if you're a C++ programmer.

Lyle
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GNU/Linux vs. GNU/OpenSolaris win32sux Linux - Software 5 11-27-2005 10:10 AM
newb question on GNU glibc-2.3.1 upgrade to GNU glibc-2.3.2 clindy528 Slackware 1 11-10-2005 06:49 AM
Regex Help cmfarley19 Programming 5 03-31-2005 10:13 PM
GNU Pascal calls GNU C chris.hicks Programming 0 11-13-2003 11:18 AM
GNU C calls GNU Pascal? chris.hicks Programming 1 11-13-2003 08:48 AM


All times are GMT -5. The time now is 04:52 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration