bug-gnulib
[Top][All Lists]
Advanced

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

Re: Plain text matching with regex: RE_PLAIN


From: Bruno Haible
Subject: Re: Plain text matching with regex: RE_PLAIN
Date: Wed, 15 Sep 2010 03:54:45 +0200
User-agent: KMail/1.9.9

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].

> 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].
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.

Bruno


[1] http://clisp.cons.org/impnotes/regexp-mod.html#ex-re-quote
[2]  
http://clisp.cvs.sourceforge.net/viewvc/clisp/clisp/modules/regexp/regexp.lisp?revision=1.29&content-type=text%2Fplain
[3] http://www.gnu.org/software/gnulib/manual/html_node/Extending-Gnulib.html



reply via email to

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