regexp confusion

M

MD

What do most of the experienced programmers here do when they
encounter a situation, constrained to a C programming env obviously,
where they could
use a regexp system?

I find the regcomp(), regexec(),system a little unwieldy, especially
when
dealing with user inputted expressions. Is there example code someone
can point
me to as a howto on dealing with regexp issues?
 
T

Trent Buck

Quoth MD on or about 2004-11-15:
I find the regcomp(), regexec(),system a little unwieldy, especially

Allow me to jump in before the *real* zealots.

regcomp et al are part of the POSIX standard. In c.l.c parlance, this
means they are not standard C!

To the best of my knowledge, standard C has no functions for
manipulating regular expressions. I suggest you try
comp.programmer.unix, before you are shouted at.

-trent
 
R

Robert Gamble

What do most of the experienced programmers here do when they encounter
a situation, constrained to a C programming env obviously, where they
could
use a regexp system?

I find the regcomp(), regexec(),system a little unwieldy, especially
when
dealing with user inputted expressions. Is there example code someone
can point
me to as a howto on dealing with regexp issues?

The C Standard does not provide any real regular expression functionality,
the functions you referenced are part of the POSIX standard which is not
discussed here. You should post your question over at
comp.unix.programmer where this will be on-topic.

<OT>
I am not sure what you mean by unwieldly, the functions are fairly
straight-forward. My personal preference is the pcre library (not part of
any standard) which implements powerful regex functionality of the Perl
language and is well documented. You can learn more at www.pcre.org.
</OT>

Rob Gamble
 
R

Richard Bos

What do most of the experienced programmers here do when they
encounter a situation, constrained to a C programming env obviously,
where they could use a regexp system?

In comp.lang.c, find one of the many libraries which implement regexes
in ISO C. There's no function in the Standard which implements them
directly, but it's quite possible to write some in nothing but ISO C.
I find the regcomp(), regexec(),system a little unwieldy, especially
when dealing with user inputted expressions.

Neither regcomp() nor regexec() are Standard. If they're POSIX, ask in
comp.unix.programmer.

Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top