469,356 Members | 2,013 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,356 developers. It's quick & easy.

C regex equiv to Python implementation?

I've been writing code in Python to prototype part of an application.
I've used the re regular expression pattern matcher. Now I have to take
what I've written and recode it in C to fit in an existing C app.

Anyway, is there a way to use the re regular expression evaluator in C?
Is it written in C?

Or does anyone know of a similar one that does search and match in
close to the same fashion with begin and end values returned?

Jan 6 '06 #1
3 1124
>>>>> techiepundit <te**********@futurepundit.com> writes:
I've been writing code in Python to prototype part of an application.
I've used the re regular expression pattern matcher. Now I have to take
what I've written and recode it in C to fit in an existing C app.


What platform? Linux includes a regex(7) implementation in the C
library. However, it doesn't support many of the extensions that Python
regexes support. Try http://www.pcre.org/. There are pre-build binaries for
Windows also.

Ganesan

--
Ganesan Rajagopal (rganesan at debian.org) | GPG Key: 1024D/5D8C12EA
Web: http://employees.org/~rganesan | http://rganesan.blogspot.com
Jan 6 '06 #2
Ganesan,

I'm trying to stay portable between Windows and Linux. My app will run
on Linux when deployed. But we do a lot of simulation on Windows
because of better dev tools available on Windows.

So I really want a regular expression implementation that'll compile
under MS VS 2003 C++ and also under Gnu C++ for Linux on both x86 and
ARM targets.

Jan 7 '06 #3
On 6 Jan 2006 11:24:14 -0800, te**********@futurepundit.com <te**********@futurepundit.com> wrote:
Ganesan,

I'm trying to stay portable between Windows and Linux. My app will run
on Linux when deployed. But we do a lot of simulation on Windows
because of better dev tools available on Windows.
(Lots of people seem to do so, and I can't understand why. I tend to
translate that to "we're not comfortable with working on our target
platform" ...)
So I really want a regular expression implementation that'll compile
under MS VS 2003 C++ and also under Gnu C++ for Linux on both x86 and
ARM targets.


Read the parent posting again. He recommended PCRE as the best compatible
solution. It would surprise me /a lot/ if that didn't compile on Windows.

/Jorgen

--
// Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu
\X/ snipabacken.dyndns.org> R'lyeh wgah'nagl fhtagn!
Jan 8 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Andrew Robert | last post: by
3 posts views Thread by gisleyt | last post: by
15 posts views Thread by Kay Schluehr | last post: by
10 posts views Thread by igor.kulkin | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.