emacs-devel
[Top][All Lists]
Advanced

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

Re: using non-Emacs regexp syntax


From: Paul Pogonyshev
Subject: Re: using non-Emacs regexp syntax
Date: Wed, 29 Nov 2006 21:06:24 +0200
User-agent: KMail/1.7.2

Richard Stallman wrote:
>     Is there a function to convert non-Emacs regexps (e.g. "ab(c+|d)" to
>     Emacs regexps (example to "ab\(c+\|d\)")?
> 
> The first form appears to be an "extended regexp" or egrep-style regexp.
> The second appears to be a "basic regexp" or grep-style regexp.
> 
> This conversion feature in Lisp would be useful to add after the release.

If you don't mind, I'll work on it now.  Changes can be added to whatever
.el file in the distribution later.

Also, is there sense in supporting conversion to and from several formats?
E.g. some require that plus operator is escaped, while everything else is
not.  E.g. something like this:

        (convert-regexp :sed :emacs some-regexp)
                        FROM   TO   PATTERN-STRING

Of course, it will add more complexity, but it shouldn't be much of a
problem for users of this function and implementing it in Lisp should still
be not hard.

Paul




reply via email to

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