From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Pogonyshev Newsgroups: gmane.emacs.devel Subject: Re: using non-Emacs regexp syntax Date: Wed, 29 Nov 2006 21:06:24 +0200 Message-ID: <200611292106.24231.pogonyshev@gmx.net> References: <200611282256.32673.pogonyshev@gmx.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1164827221 18677 80.91.229.2 (29 Nov 2006 19:07:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 29 Nov 2006 19:07:01 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 29 20:06:54 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GpUl4-000621-CQ for ged-emacs-devel@m.gmane.org; Wed, 29 Nov 2006 20:06:14 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GpUl3-0000Yy-Em for ged-emacs-devel@m.gmane.org; Wed, 29 Nov 2006 14:06:13 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GpUhT-0005y2-Er for emacs-devel@gnu.org; Wed, 29 Nov 2006 14:02:31 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GpUhQ-0005vH-Nb for emacs-devel@gnu.org; Wed, 29 Nov 2006 14:02:30 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GpUhQ-0005uW-8O for emacs-devel@gnu.org; Wed, 29 Nov 2006 14:02:28 -0500 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.52) id 1GpUhN-0001sb-QY for emacs-devel@gnu.org; Wed, 29 Nov 2006 14:02:26 -0500 Original-Received: (qmail invoked by alias); 29 Nov 2006 19:02:20 -0000 Original-Received: from unknown (EHLO [80.94.230.71]) [80.94.230.71] by mail.gmx.net (mp001) with SMTP; 29 Nov 2006 20:02:20 +0100 X-Authenticated: #16844820 Original-To: emacs-devel@gnu.org, rms@gnu.org User-Agent: KMail/1.7.2 In-Reply-To: Content-Disposition: inline X-Y-GMX-Trusted: 0 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:63059 Archived-At: 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