On 15 September 2010 02:09, Eric Blake <ebl...@redhat.com> wrote:
> On 09/14/2010 06:27 PM, Reuben Thomas wrote:
>>
>> The attached patch adds a new syntax flag, RE_PLAIN.
>
> Why can't you instead add \ escaping to all existing regex meta-characters
> that occur in the string, at which point you get the same effect without a
> new flag?

Because that is error-prone (in particular, I would have to take the
current syntax into account). So, I could do it reliably by writing
and testing a routine to do it, but that would be significantly more
code (to avoid creating the same problem for others, it would need to
be added to GNU regex, not just used by me). It would also be harder
to use: once you make a new string, you have to consider allocation in
C.

Rather than bother with all that, it's simpler just to write a
plain-text matching routine, but then I'm back where I started.

> And while the addition of a new flag may be worthwhile, I think
> that the divergence between glibc and gnulib is already too far; you need to
> get this approved in glibc before we go adding it to gnulib and hurt our
> chances of merging yet another difference between the two code bases.

I'll give it a go.

In the meantime is there any better way to use this for myself than
simply maintaining a variant version of GNU regex? e.g. some way of
maintaining a patch against gnulib...

-- 
http://rrt.sc3d.org

Reply via email to