Re: Regular Expressions in C

From: Pierre Asselin (pa_at_invalid.invalid)
Date: 05/08/04


Date: Fri, 7 May 2004 20:05:28 -0400

Thomas Deschepper <thomas.deschepper.ecol@sintjozefscollege.be> wrote:
> Some time ago, I learned some Perl and I read the Llamabook. I found out
> that Perl had a cool and relative simple work method for extracting data
> from a string provided by the user using regular expressions and match
> variables.

> Now, I want to achieve the same but this time in C. How can I "parse" a
> char array and get the things I need. Let me illustrate with an example.

man regcomp .

> Say I wanted to parse a mathematical function to plot it on the screen.
> The user could provide me with the following string:

> y = 5*x + 5
> or
> y=5 * x+ 5 (extra spaces)

Uh, maybe you want more than regular expressions. Investigate lex and
yacc (or flex and bison).



Relevant Pages

  • Re: Serious Perl Regular Expression deficiency?
    ... I started doing Perl 2 years ago and have ... > conclusion that regular expressions have a serious ... This is serious because the not string ... If you want to pull out the contents of XML comments you could do this. ...
    (comp.lang.perl.misc)
  • Serious Perl Regular Expression deficiency?
    ... After extensive read on the Perl docs on re's ... conclusion that regular expressions have a serious ... This is serious because the not string ... howdy folks --> ...
    (comp.lang.perl.misc)
  • Re: perl question
    ... that an exact string match is only ... function will be more efficient than regular expression matching. ... For a gentle introduction to regular expressions, ... You may find that the Perl ...
    (comp.os.vms)
  • Re: Serious Perl Regular Expression deficiency?
    ... I started doing Perl 2 years ago and have ... >> conclusion that regular expressions have a serious ... This is serious because the not string ... >If you want to pull out the contents of XML comments you could do this. ...
    (comp.lang.perl.misc)
  • Cant Compiling perl5.8.8 on FreeBSD6.2
    ... WITH_DEBUGGING=yes Build perl with debugging support. ... First let's make sure your kit is complete. ... What is the file extension used for shared libraries? ... I'll use sprintf to convert floats into a string. ...
    (comp.unix.bsd.freebsd.misc)