Can we do regular expression processing in C ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mahendra Kutare

    Can we do regular expression processing in C ?

    Or do we need to have any specific library ?

    I am more interested in knowing if we can do string pattern matching
    regular expression processing with C.

    Thanks
    Mahendra
  • Ian Collins

    #2
    Re: Can we do regular expression processing in C ?

    Mahendra Kutare wrote:
    Or do we need to have any specific library ?
    >
    I am more interested in knowing if we can do string pattern matching
    regular expression processing with C.
    >
    Not in standard C, there are plenty of extensions (POSIX regex for example).

    --
    Ian Collins.

    Comment

    • Don Bruder

      #3
      Re: Can we do regular expression processing in C ?

      In article <65g9ppF2g815vU 4@mid.individua l.net>,
      Ian Collins <ian-news@hotmail.co mwrote:
      Mahendra Kutare wrote:
      Or do we need to have any specific library ?

      I am more interested in knowing if we can do string pattern matching
      regular expression processing with C.
      Not in standard C, there are plenty of extensions (POSIX regex for example).
      And I betcha that was written in ... wait for it ... C!

      Yes, you can indeed do regular expression processing in C. Even in
      absolutely 100% standard C.

      You can do *DAMN NEAR ANYTHING* in standard C. (Even *THAT*? Get your
      mind out of the gutter! I said "damn near"! :) )

      You just have to be willing (and able) to write the code to do it if you
      don't have (or for some reason don't want to/aren't allowed to use) a
      library routine that already does it for you.

      Fortunately, at this stage in the game there are many excellent
      libraries available out there that do many useful things, and they are
      perfectly compatible with standard C (and quite possibly written in
      standard C) even if they aren't specced by the C standard as being
      officially part of the language. Not being required by the standard
      doesn't make them any less "standard C".

      --
      Don Bruder - dakidd@sonic.ne t - If your "From:" address isn't on my whitelist,
      or the subject of the message doesn't contain the exact text "PopperAndShado w"
      somewhere, any message sent to this address will go in the garbage without my
      ever knowing it arrived. Sorry... <http://www.sonic.net/~dakiddfor more info

      Comment

      • Ian Collins

        #4
        Re: Can we do regular expression processing in C ?

        Don Bruder wrote:
        In article <65g9ppF2g815vU 4@mid.individua l.net>,
        Ian Collins <ian-news@hotmail.co mwrote:
        >
        >Mahendra Kutare wrote:
        >>Or do we need to have any specific library ?
        >>>
        >>I am more interested in knowing if we can do string pattern matching
        >>regular expression processing with C.
        >>>
        >Not in standard C, there are plenty of extensions (POSIX regex for example).
        >
        Not being required by the standard doesn't make them any less "standard C".
        >
        OK, to disambiguate my reply further, regular expressions are not part
        of the standard library.

        --
        Ian Collins.

        Comment

        • Jack Klein

          #5
          Re: Can we do regular expression processing in C ?

          On Wed, 02 Apr 2008 15:36:41 +1300, Ian Collins <ian-news@hotmail.co m>
          wrote in comp.lang.c:
          Mahendra Kutare wrote:
          Or do we need to have any specific library ?

          I am more interested in knowing if we can do string pattern matching
          regular expression processing with C.
          Not in standard C, there are plenty of extensions (POSIX regex for example).
          I disagree, one most certainly can.

          There are no functions for doing this in the standard library, so one
          would have to either write them, or find a library that already
          contained them. But such a library could be written in strictly
          conforming C, at least for the ASCII character set.

          --
          Jack Klein
          Home: http://JK-Technology.Com
          FAQs for
          comp.lang.c http://c-faq.com/
          comp.lang.c++ http://www.parashift.com/c++-faq-lite/
          alt.comp.lang.l earn.c-c++

          Comment

          • Ian Collins

            #6
            Re: Can we do regular expression processing in C ?

            Jack Klein wrote:
            On Wed, 02 Apr 2008 15:36:41 +1300, Ian Collins <ian-news@hotmail.co m>
            wrote in comp.lang.c:
            >
            >Mahendra Kutare wrote:
            >>Or do we need to have any specific library ?
            >>>
            >>I am more interested in knowing if we can do string pattern matching
            >>regular expression processing with C.
            >>>
            >Not in standard C, there are plenty of extensions (POSIX regex for example).
            >
            I disagree, one most certainly can.
            >
            There are no functions for doing this in the standard library, so one
            would have to either write them, or find a library that already
            contained them. But such a library could be written in strictly
            conforming C, at least for the ASCII character set.
            >
            Didn't you see the clarification I posted an hour earlier?

            --
            Ian Collins.

            Comment

            • Jack Klein

              #7
              Re: Can we do regular expression processing in C ?

              On Wed, 02 Apr 2008 17:23:03 +1300, Ian Collins <ian-news@hotmail.co m>
              wrote in comp.lang.c:
              Jack Klein wrote:
              On Wed, 02 Apr 2008 15:36:41 +1300, Ian Collins <ian-news@hotmail.co m>
              wrote in comp.lang.c:
              Mahendra Kutare wrote:
              >Or do we need to have any specific library ?
              >>
              >I am more interested in knowing if we can do string pattern matching
              >regular expression processing with C.
              >>
              Not in standard C, there are plenty of extensions (POSIX regex for example).
              I disagree, one most certainly can.

              There are no functions for doing this in the standard library, so one
              would have to either write them, or find a library that already
              contained them. But such a library could be written in strictly
              conforming C, at least for the ASCII character set.
              Didn't you see the clarification I posted an hour earlier?
              Actually, I didn't, nor Don Bruder's reply that prompted it, otherwise
              I would not have posted the amplification.

              SuperNews just switched their servers on March 31, and my feed has
              been a bit spotty since. Hopefully they'll have it squared away in
              another day or two.

              --
              Jack Klein
              Home: http://JK-Technology.Com
              FAQs for
              comp.lang.c http://c-faq.com/
              comp.lang.c++ http://www.parashift.com/c++-faq-lite/
              alt.comp.lang.l earn.c-c++

              Comment

              Working...