pattern matching in c 
Author Message
 pattern matching in c

Gnu has a regexp.  Try a web search for this sort of thing
--
Hypertext C-FAQ: http://www.*-*-*.com/ ~scs/C-faq/top.html
C-FAQ ftp: ftp://rtfm.mit.edu, C-FAQ Book: ISBN 0-201-84519-9
Try "C Programming: A Modern Approach" ISBN 0-393-96945-2
Want Software?  Algorithms?  Pubs? http://www.*-*-*.com/



Sun, 17 Sep 2000 03:00:00 GMT  
 pattern matching in c

How do you do pattern matching in c?
I want to see if a word appears in a string.  Right now I have the folowing:

   if ((stream = popen(command, "rt")) == NULL) {
      printf("Error starting the command pipe .\n");
   }
   else {
      while(!feof(stream)) {  
         get line from stream
         if (there is pattern1 in  stream) {
            do this
         }
         else if (there is pattern 2 in stream) {
            do that
         }
         else {
            do somehting else
         }
      }
   }

Is this possible?  
The more i think about this the more i wish i was using perl :)

Thanks,
-Ali M.



Mon, 18 Sep 2000 03:00:00 GMT  
 pattern matching in c

: Gnu has a regexp.  Try a web search for this sort of thing
: --
: Hypertext C-FAQ: http://www.eskimo.com/~scs/C-faq/top.html
: C-FAQ ftp: ftp://rtfm.mit.edu, C-FAQ Book: ISBN 0-201-84519-9
: Try "C Programming: A Modern Approach" ISBN 0-393-96945-2
: Want Software?  Algorithms?  Pubs? http://www.infoseek.com

Hi,
I did do a web search and came up with nothing... maybe I was
looking at the wrong places.
BTW, I am developeing on NT platform using MS VC++ compiler, so I can't use
GNU.

Thanks,
-Ali M.



Mon, 18 Sep 2000 03:00:00 GMT  
 pattern matching in c

You tried a web search with "regexp" and found nothing?

Look at my sig for a clue.  You should do better than that.

--
C-FAQ ftp sites: ftp://ftp.eskimo.com ftp://rtfm.mit.edu
Hypertext C-FAQ: http://www.eskimo.com/~scs/C-faq/top.html
C-FAQ Book: ISBN 0-201-84519-9.
Want Software?  Algorithms?  Pubs? http://www.infoseek.com



Mon, 18 Sep 2000 03:00:00 GMT  
 pattern matching in c

|: Gnu has a regexp.  Try a web search for this sort of thing
||I did do a web search and came up with nothing... maybe I was
|looking at the wrong places.
|BTW, I am developeing on NT platform using MS VC++ compiler, so I can't use
|GNU.

It is simply not true that you cannot use GNU routines in MS VC++/NT
compiled
programs.  (Please move any GPL discussion outside of comp.lang.c, however).
The GNU sources are available from (among other places)
ftp://prep.ai.mit.edu.
For alternate sites (recommended) see www.fsf.org or
www.gnu.org/order/ftp.html

.



Mon, 18 Sep 2000 03:00:00 GMT  
 pattern matching in c


Quote:

>You tried a web search with "regexp" and found nothing?

The problem would rather be with finding too much!

There's a pointer to Henry Spencer's regular expression library in the
FAQ.  This is certainly a good place to start.

Cheers,
Richard
--
Richard Stamp
Churchill College, Cambridge



Mon, 18 Sep 2000 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Regular Expressions/Pattern Matching/Unordered pattern

2. Pattern Matching in C -

3. Pattern Matching Tool

4. Pattern Matching in C

5. pattern matching and string replacement

6. help with a fast pattern matching utility requested

7. Pattern Matching in execution time

8. pattern matching with the function glob.

9. Performance while regexp pattern matching

10. HTML scraping (WSDL HTML pattern matching)

11. Request for Sample Code in case sensitive pattern matching of string in C

12. Help with Pattern Matching!

 

 
Powered by phpBB® Forum Software