[Top][All Lists]

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

Re: [bug-gnulib] Does regex.c support non-greedy quantifiers?

From: Hrvoje Niksic
Subject: Re: [bug-gnulib] Does regex.c support non-greedy quantifiers?
Date: Mon, 11 Apr 2005 16:22:11 +0200
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

Stepan Kasal <address@hidden> writes:

> On Mon, Apr 11, 2005 at 12:15:32PM +0200, Hrvoje Niksic wrote:
>> Does gnulib's regex.c support Perl-style non-greedy quantifiers,
>> specified by appending "?" to "*"?  GNU Emacs 21.4 seems to support
>> them, and I understand that gnulib's regex.c comes from Emacs.
> yes, the current version of regex.c in gnulib originated from Emacs.
> But I think there is consensus that this version should be replaced
> by the regex code from GNU C Library (glibc).

I see.  Has that code been used and tested outside glibc?  Is it
portable to non-glibc systems?

> I'm afraid that that version doesn't handle non-greedy matching.

Then it's certainly no more useful to me than gnulib's regex.c -- see
the very first question in my original message.

> A cheeky question: when you want perl-like features in your regexes,
> wouldn't pcre match your needs better?

That is a valid question.  I considered PCRE, but unfortunately had to
reject it for several reasons:

* I'd like Wget to remain compilable without relying on third-party
  libraries.  This is especially important for compilation under
  Windows, where header locations depend on the compiler.

* Bundling the PCRE would probably require assignments to FSF.

* Bundling a (non-trivial) external library opens a can of worms,
  maintenance-wise.  For one, the impedance mismatch between Autoconf
  and libtool setups of PCRE and Wget is a potential hassle (I can
  easily imagine PCRE require one version of Autoconf and Wget
  another, to name an example.)  More seriously, security problems and
  bugs in the bundled library would require updates to Wget, which is
  clearly undesirable.

regex.c, on the other hand, has a long history of being successfully
bundled with various GNU programs.

Maybe I should just try to take the latest regex.c from GNU Emacs CVS
and see if that works for me.  It should also be noted that GNU grep,
according to its manual, supports Perl-like regular expressions and is
also worth looking into.

reply via email to

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