Pattern Matching in execution time 
Author Message
 Pattern Matching in execution time

   I am looking for a function call which does the same thing as "grep" but in a
   function call not as a command; the function should return 1 if it finds the
   pattern or return 0 if it does not find the pattern in a file.

Try the GNU rx library at ftp://ftp.gnu.org/pub/gnu/rx-1.5.tar.gz.



Sun, 10 Dec 2000 03:00:00 GMT  
 Pattern Matching in execution time

Quote:


> > I am looking for a function call which does the same thing as "grep" but in a
> > function call not as a command; the function should return 1 if it finds the
> > pattern or return 0 if it does not find the pattern in a file.

> > Thanks in advance for any hints,

> > Yang Xiang

Here is a simple alternative also:

     ret = !system("grep HHSJS filenm");

ret is 1 or 0 for found or not-found.



Sun, 10 Dec 2000 03:00:00 GMT  
 Pattern Matching in execution time


:Have a go using the regcomp function - looks like the simplest way !!
:
:Cheers,
:
:Jason Hambleton

:
============
Jason,
comp.lang.c is governed by the standard for C - ISO 9899:1990 .
regcomp() is part of another standard - POSIX 1003.2.
It requires the #inclusion of the non-standard (so off-topic)
header <regex.h> and, on many systems, <sys/types.h>.
There are many perfectly legal C implementations with
neither of these.

It is for these reasons that your solution is not appropriate
for comp.lang.c, although a private suggestion by e-mail
would have been fine.


/* Newsgroup posts also e-mailed */



Mon, 11 Dec 2000 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Regular Expressions/Pattern Matching/Unordered pattern

2. Execution time bottleneck: How to speed up execution?

3. Pattern Matching in C -

4. Pattern Matching Tool

5. Pattern Matching in C

6. Help, Pattern used in Regex.Matches(...)

7. pattern matching and string replacement

8. help with a fast pattern matching utility requested

9. pattern matching with the function glob.

10. Performance while regexp pattern matching

11. pattern matching in c

12. HTML scraping (WSDL HTML pattern matching)

 

 
Powered by phpBB® Forum Software