[net.unix] Is there a public domain version of regex

guido@mcvax.UUCP (Guido van Rossum) (12/13/84)

[If you see this message in three groups, update your news software!]

I am writing an editor which, for compatibility's sake, must include a
regular expression matching function exactly as that in ed(1) (with which
our secretaries grew up -- not the most progressive force in the world. :-)

BSD unix systems document this as regex(3), but I don't want to make
my code dependent on BSD, or even unix, for that matter.
I can't just put a copy of BSD's regex.c in my distribution, because
this would violate all sorts of copyright restrictions (I suppose).

So...

Does anyone know of a public domain program which does the same?
(If not, I guess I'll write it myself, but it's not my idea of fun.)

--
	Guido van Rossum, CWI, Amsterdam
	guido@mcvax.UUCP

"You're right.  But you're boring."

guido@mcvax.UUCP (Guido van Rossum) (12/19/84)

In article <6237@mcvax.UUCP> I asked if there were any public domain
versions of regex(3).  I got many replies, both helpful suggestions
where to look and messages saying "mail me what you've got".  Thanks
to all who responded; for those who wanted to see what I got, here's
a summary.

The most important message (for me) was one quoting Mark Horton saying
that the regex.c that comes with BSD *is* public domain (though it has
nothing to do with the regex(3) in System V, which is certainly *not*
public domain).

I also got several pointers to various public domain packages that do
regular expression matching:

    Richard Stallman's public-domain version of UNIX (GNU) has one;
	contact RMS@MIT-MC.ARPA
    Larry Wall's "rn" has r.e. matching in search.[ch] (ripped out of emacs
	and made more general); see net.sources or contact sdcrdcf!lwall
    Kernighan & Plaugher, Software Tools in {C, Pascal}, Addison-Wesley;
	contact your local computer bookstore
    The DECUS C distribution should have one; maybe it's in DECUS grep.
    John Pierce has a version; sdcsvax!sdchema!jwp
    Dave Tilbrook's QED/TIPS (not sure if it's public domain?
	contact mcvax!qtlon!ist!dt)

If you want more specific info, drop me a note, and I'll mail you the
full file of responses.

--
	Guido van Rossum, "Stamp Out BASIC" Committee, CWI, Amsterdam
	guido@mcvax.UUCP

1,$s/\([^:]*:\)[^:]*\(:.*\)/\1\2/ (that's why I like regular expressions :-)