From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alexis Newsgroups: gmane.emacs.devel Subject: Re: Regular expression creation [was: Re: Emacs Lisp's future] Date: Fri, 19 Sep 2014 20:07:05 +1000 Message-ID: <87tx43x6gb.fsf@gmail.com> References: <87wq97i78i.fsf@earlgrey.lan> <20140917202418.240bbd2c@forcix> <87egv9y5m6.fsf@gmail.com> <541B0AFC.9080501@dancol.org> <87zjdwwpab.fsf@gmail.com> <87y4tgwjso.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1411121761 18471 80.91.229.3 (19 Sep 2014 10:16:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 19 Sep 2014 10:16:01 +0000 (UTC) To: Emacs development discussions Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 19 12:15:54 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XUvEH-0000Ct-1J for ged-emacs-devel@m.gmane.org; Fri, 19 Sep 2014 12:15:53 +0200 Original-Received: from localhost ([::1]:57260 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUvEG-0001YG-B4 for ged-emacs-devel@m.gmane.org; Fri, 19 Sep 2014 06:15:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUvDZ-0001LO-HS for emacs-devel@gnu.org; Fri, 19 Sep 2014 06:15:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUvDO-0007AL-Jk for emacs-devel@gnu.org; Fri, 19 Sep 2014 06:15:09 -0400 Original-Received: from mail-pa0-x234.google.com ([2607:f8b0:400e:c03::234]:40188) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUvDO-00079U-Cb for emacs-devel@gnu.org; Fri, 19 Sep 2014 06:14:58 -0400 Original-Received: by mail-pa0-f52.google.com with SMTP id kq14so3531799pab.25 for ; Fri, 19 Sep 2014 03:14:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:from:to:subject:date:in-reply-to:message-id:mime-version :content-type; bh=7Ve81XHT+FBwbcl//Nv1SxMWDjanS0Lfp38bg3u7LIw=; b=btPAkGIiWPrVmCv2vlPMCv7eXaTqYlMrWzWkExlel5QEAPbVxLHtXA9g61VhK/l5Bo vM2S7nlFVlnjqJG2zt4q5iVL59MeFcVVjNJ3lpMIQQy3lajDgtZtP7DpXlj3U4IVHGQk y+k8lBiVTOsVwBAUFOrAzZTnuR9NX0BvyNi98+Qn51P89W8VXj6DYfGZJsv7yDNYe2ie FkEfL/sU/5w67K4SWJ64BP0UUf0t+JGApiDpC11qZy1hQykTNcd4HiRVyBGQcNP/B9fC IMVQc8P9d/2iG0U7LHcw2CtqBuDMGJmYfIxKGXGP2ZCvtmeNhGjGlmQKgWnaRgDNvOiu Txvg== X-Received: by 10.66.65.130 with SMTP id x2mr13873799pas.79.1411121691969; Fri, 19 Sep 2014 03:14:51 -0700 (PDT) Original-Received: from localhost (ppp118-209-61-149.lns20.mel4.internode.on.net. [118.209.61.149]) by mx.google.com with ESMTPSA id je2sm1405349pbd.94.2014.09.19.03.14.49 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 19 Sep 2014 03:14:50 -0700 (PDT) In-reply-to: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c03::234 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:174540 Archived-At: Stefan Monnier writes: >> debates around raw strings, i still feel something like Stefan's >> suggestion for a built-in `re-escape` function would probably solve most >> of the issues i have with ELisp REs. > > And note that re-escape should be easy to write. I guess the main issue > would be to decide what escape character to use (assuming "(" is used for > regexp-grouping, what should be used to match a plain open-parenthesis? > "\(" is not an option since it's the same string as "(", so you either > have to go with "\\(" which (as we know) sucks, or choose another escape > char than backslash). Hmm, good point .... Perhaps "!" could be the escape character? It seems to me like a character that might be less likely to need to be literally matched (or matched less frequently) than other visible ASCII characters, and also seems to me to be reasonably memorable for this purpose .... Alexis.