[comp.sys.ibm.pc] Pattern Matching for the PC

brb@briar.philips.com (Brian Bertan;6309;4.88;$0202) (11/14/89)

I am interested in C and Pascal source code or libraries having extensive 
string parsing functions including pattern matching with regular expressions.

If no source or library is available, is there any literature describing how to 
implement the above?


Thanks,

Brian

Brian Bertan
Philips Labs
345 Scarborough Rd.
Briarcliff Manor, NY 10510
(914) 945-6309

brb@philabs.philips.com

ron@woan.austin.ibm.com (Ronald S. Woan) (11/14/89)

In article <67975@philabs.Philips.Com>, brb@briar.philips.co
Bertan;6309;4.88;$0202) writes:
> 
> I am interested in C and Pascal source code or libraries having extensive 
> string parsing functions including pattern matching with regular expressions.
> 
> If no source or library is available, is there any literature describing how 
> to implement the above?

Why not look at the source for GNU grep or GNU AWK (GAWK)? At least both
are freely available and have been ported to the PC/MSDOS world. Look on  
simtel20 for the source and executables for GAWK (pd1:<msdos.awk>) and
and grep (pd1:<msdos.txtutl>).

						Ron

+-----All Views Expressed Are My Own And Are Not Necessarily Shared By------+
+------------------------------My Employer----------------------------------+
+ Ronald S. Woan  (IBM VNET)WOAN AT AUSTIN, (AUSTIN)ron@woan.austin.ibm.com +
+ outside of IBM       @cs.utexas.edu:ibmaus!auschs!woan.austin.ibm.com!ron +
+ last resort                                        woan@peyote.cactus.org +

pipkins@qmsseq.imagen.com (Jeff Pipkins) (11/14/89)

In article <67975@philabs.Philips.Com> brb@briar.philips.com (Brian Bertan;6309;4.88;$0202) writes:
>
>I am interested in C and Pascal source code or libraries having extensive 
>string parsing functions including pattern matching with regular expressions.
>If no source or library is available, is there any literature describing how to 
>implement the above?

Check out a book called "Software Tools" by Brian Kernighan and P.J. Plauger,
published by Addison Wesley.  This book is one of the classics and most
unix programs that support regular expressions most likely use some derivation
of their algorithms.  The code is in C and RATFOR; there is a Pascal =8-Q
version of the book available, called "Software Tools in Pascal".

Dr. Dobb's Journal (M&T Publishing) has a version of grep written by
Alan Hollub that is also available (I think it's about $15).

There are better ways of dealing with regular expressions than are presented
in either of these references, but I haven't seen code readily available
for them.  If you want to know more about regular expressions and
language theory in general, check out "Compilers -- Principles, Techniques,
and Tools" by Aho, Sethi, and Ullman, and "Introduction to Automata
Theory, Languages, and Computation" by Hopcroft and Ullman.  Both books
are published by Addison Wesley, with which I am totally unaffiliated except
for the fact that I have a lot of their books and they have a LOT of my
money!

jaswal@s.cs.uiuc.edu (11/17/89)

The June '89 issue of Dr Dobbs Journal has an article
called "Writing AWK-like extensions in C."  If you are
familiar with UNIX AWK then you know that it has very
extensive string searching and regular expression support.

The article looks pretty good (I haven't dived into it yet)
and it comes with the C source for lots of support routines.
The routines try to integrate the basic string processing 
capabilities of AWK into C functions.

I think you can buy a disk with the source on it from DDJ
and I know it's on the net somewhere.

Vijay

nelson@sun.soe.clarkson.edu (Russ Nelson) (11/19/89)

In article <67975@philabs.Philips.Com> brb@briar.philips.com (Brian Bertan;6309;4.88;$0202) writes:

   I am interested in C and Pascal source code or libraries having
   extensive string parsing functions including pattern matching with
   regular expressions.

Henry Spencer's regexp code compiling under Turbo C with no modifications.
Available from your better sources archives (including uunet).
--
--russ (nelson@clutx [.bitnet | .clarkson.edu])
Live up to the light thou hast, and more will be granted thee.
A recession now appears more than 2 years away -- John D. Mathon, 4 Oct 1989.
I think killing is value-neutral in and of itself. -- Gary Strand, 8 Nov 1989.