On 15 September 2010 02:54, Bruno Haible <br...@clisp.org> wrote:
> Hi Reuben,
>
>> > 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).
>
> Error-prone? No, it's a function which transforms a string to a string.
> I'm sure this function has been implemented many times already. The one I
> wrote is called 'regexp-quote' [1][2].

Great, can we have it in gnulib? Does it work for all syntaxes?

>> 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...
>
> Yes, you can maintain patches against gnulib, see the gnulib documentation 
> [3].

Thanks.

> But in this case I think you'll have more work maintaining this patch in the
> long run than with a string -> regex function like the one Eric suggested.

Given a) the simplicity of my patch, and b) the amount of code it
saves in the application, it may just be worth maintaining it.

-- 
http://rrt.sc3d.org

Reply via email to