bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Documenting the several dialects of regexp understood by gnulib


From: James Youngman
Subject: Documenting the several dialects of regexp understood by gnulib
Date: Thu, 14 Jul 2005 23:52:02 +0100
User-agent: Mutt/1.5.9i

Hello,

Some time (and sadly, a public release) back I inadvisedly changed the
default regexp syntax understood by GNU find from Emacs to POSIX
Basic.  The syntax-controlling variable had previously been
uninitialised (hence being RE_SYNTAX_EMACS by coincidence).  This
turned out to break some shell scripts.  Hence I decided to change
things back, which is when I discovered the RE_ICASE problem that Paul
recently solved.

Anyway, I decided to make the syntax user-configurable, and so now GNU
find supports a -regextype option allowing the user to select between
most of the dialects supported by gnulib.  This unifies the regex
support of "find" and "locate".

Documentation was of course the obvious problem.  Rather than fully
document all the varieties of regexps I decided to provide reference
information describing how the syntaxes differ.  I therefore wrote a C
program which reads the flags in gnulib's RE_SYNTAX_* macros and emits
a Texinfo description of all the syntaxes.

Because the resulting text is written by computer and in any case this
is a first go at this, the result is not as readable as it could be,
but I thought I'd share the program.  It's attached.  The code is
included in the current findutils development stream.  The
regexprops.c program would document all of the syntaxes, but currently
only documents some of them, simply because the symbol-to-option-value
table in regextype.c doesn't include all the possible syntaxes (I
didn't think that ed(1) was a useful option, for example).

Regards,
James.

Attachment: regextype.c
Description: Text Data

Attachment: regextype.h
Description: Text Data

Attachment: regexprops.c
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]