bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: Bug Report: \y, \B, \<, \> do not work with _


From: Aharon Robbins
Subject: Re: Bug Report: \y, \B, \<, \> do not work with _
Date: Thu, 07 Dec 2000 16:11:53 +0200

> Subject: Re: Bug Report: \y, \B, \<, \> do not work with _
> From: Akim Demaille <address@hidden>
> Date: 07 Dec 2000 10:35:17 +0100
>
> Then, what I don't understand why there are two files: dfa and re.
> AFAICT they are really different, i.e., they require to be maintained
> separately, so my question is more ``why do you maintain dfa _and_
> regexp in grep and gawk, instead of just maintaining a fork from
> glibc's regexp''.

The use of grep's dfa in gawk was done long ago for performance reasons.
For awk, there are two kinds of regex matching.

1. Does it match or not?  For this, using dfa is better, it's fast and
   returns a yes/no answer.

2. Where does the match start and end?  We needs this for match() and
   sub()/gsub(), and for that we have to take the performance hit of
   calling into regex.

I try to stay in sync with both grep and glibc, but will apply fixes as
needed for portability or functionality (and feed them back, of course).
These days this happens less often, but for a while regex was
maintainerless, and when Ulrich picked it back up, he started with
gawk's version.

It is a dream of mine to one day move to a single matcher, but no-one
has yet written one that (a) provides start/end info, (b) is fast, and
(c) understands all the address@hidden&* regex syntax bits. (I seem to be able
to get just any 2 out of the 3. sigh.)

Now, why grep needs regex, I don't know, but I haven't looked at the code.

I'd prefer to take any other discussion off the bug-{gawk,gnu-utils}
mailing lists.

Thanks,

Arnold
--
Aharon (Arnold) Robbins --- Pioneer Consulting Ltd.     address@hidden
P.O. Box 354            Home Phone: +972  8 979-0381    Fax: +1 603 761-6761
Nof Ayalon              Cell Phone: +972 51  297-545    (See www.efax.com)
D.N. Shimshon 99785     Laundry increases exponentially in the
ISRAEL                  number of children. -- Miriam Robbins




reply via email to

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