How to use regular expressions in C++ for Linux environment.

Posted on 2011-03-17
Last Modified: 2012-05-11

Dear experts,

I want to implement regular expressions in C++ for Linux environment. One of my friend recommended me to use REGEX Library by GNU. Could you provide me some documentation as well as code examples about using this library?

Question by:GurcanK
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 40

Accepted Solution

evilrix earned 125 total points
ID: 35155699
I'd strongly recommend you consider using the regex library that is part of boost. Not only is it a fantastic library it will end up being part of the next version of the CPP standard.
LVL 34

Assisted Solution

sarabande earned 125 total points
ID: 35155825
for C development simply do 'man regex' at the shell and you see the syntax for reccomp (compiles a regular expression) and regexec (applies the regular expression). i used it once and had no significant problems.


LVL 11

Expert Comment

ID: 35156232

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question