Regex in c?

Started by
4 comments, last by karwosts 14 years, 1 month ago
Hi, i need to parse an html response in c/c++ with the regular expressions, but i can't find a library for regex. Can someone help me?
Advertisement
Quote:Original post by roby65
Hi,
i need to parse an html response in c/c++ with the regular expressions, but i can't find a library for regex.
Can someone help me?


Try PCRE. :)
blah :)
Boost.Regex. You can also take a look at Boost.Spirit.

Quote:Original post by roby65
but i can't find a library for regex.
Did you try looking for one? Apologies for what may be a slightly harsh tone, but it seems like if you'd put in any effort you should have turned something up...
Quote:from Google search results for 'C++ regular expressions'

C++ Regular Expression Library
31 Jan 2002 - A free component that enables the use of regular expression searching in a C++ program.
www.tropicsoft.com/Components/RegularExpression/ cached - similar

Boost.Regex
28 Dec 2009 - “...one of the most highly regarded and expertly designed C++ library projects ... Introduction to using Regex with ICU · Unicode regular expression types ...
www.boost.org/doc/libs/release/libs/regex/ cached - similar


Getting started with regular expressions using C++ TR1 extensions
7 May 2008 - Getting started with regular expressions in C++ using the TR1 extension to the Standard Library. Examples comparing the C++ regular expression support to ...
www.johndcook.com/cpp_regex.html cached - similar
[...]
I'd suggest taking a look at the second result as a good potential option: Boost.Regex

Additionally, although it isn't a Regex library, depending on what you're trying to do you may find libcurl (features) useful.

Hope that helps. [smile]

- Jason Astle-Adams

There's also boost::xpressive which is a regular expression template library rather than a traditional library like boost::regex. It's sort of like boost::spirit -- allows you to write regular expressions that are hard-coded and syntax-checked by the compiler.
c++ has regex built in in std::tr1, if your compiler supports this (MSVC++ 08 does, not sure about others).

You can use that without having to add any additional libraries to your project.
[size=2]My Projects:
[size=2]Portfolio Map for Android - Free Visual Portfolio Tracker
[size=2]Electron Flux for Android - Free Puzzle/Logic Game

This topic is closed to new replies.

Advertisement