From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: Unquoted special characters in regexps Date: Fri, 03 Mar 2006 16:51:52 +0100 Message-ID: <44086618.10202@gmx.at> References: <4400AD8E.5050001@gmx.at> <4400BBB1.2050800@gmx.at> <200602252213.k1PMDBP24413@raven.dms.auburn.edu> <4401A98D.3070809@gmx.at> <4401E0F2.7030800@gmx.at> <4401FCBA.1070206@gmx.at> <200602280030.k1S0UDE07149@raven.dms.auburn.edu> <44073C08.1070903@gmx.at> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1141479182 30945 80.91.229.2 (4 Mar 2006 13:33:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 4 Mar 2006 13:33:02 +0000 (UTC) Cc: schwab@suse.de, teirllm@dms.auburn.edu, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 04 14:33:00 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 1FFWsW-0006vu-62 for ged-emacs-devel@m.gmane.org; Sat, 04 Mar 2006 14:33:00 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FFWsZ-0006H3-Dw for ged-emacs-devel@m.gmane.org; Sat, 04 Mar 2006 08:33:03 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FFVPf-0004WJ-QL for emacs-devel@gnu.org; Sat, 04 Mar 2006 06:59:08 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FFVPa-0004So-SF for emacs-devel@gnu.org; Sat, 04 Mar 2006 06:59:06 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FFESb-0005Jk-VR for emacs-devel@gnu.org; Fri, 03 Mar 2006 12:53:02 -0500 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.52) id 1FFCcI-0000LD-J7 for emacs-devel@gnu.org; Fri, 03 Mar 2006 10:54:54 -0500 Original-Received: (qmail invoked by alias); 03 Mar 2006 15:53:05 -0000 Original-Received: from N940P009.adsl.highway.telekom.at (EHLO [62.47.61.105]) [62.47.61.105] by mail.gmx.net (mp022) with SMTP; 03 Mar 2006 16:53:05 +0100 X-Authenticated: #14592706 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en Original-To: rms@gnu.org In-Reply-To: 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:51162 Archived-At: > "\\(\[[0-9]+\] \\)*\\([a-zA-Z0-9.$_]+\\)\\.[a-zA-Z0-9$_<>(),]+ \ > \\(([a-zA-Z0-9.$_]+:\\|line=\\)\\([0-9.,]+\\)" > > Experience tells me that this should be probably written as > > "\\(\\[[0-9]+\\] \\)*\\([a-zA-Z0-9.$_]+\\)\\.[a-zA-Z0-9$_<>(),]+ \ > \\(([a-zA-Z0-9.$_]+:\\|line=\\)\\([0-9.,]+\\)" > > \[ and \] in Lisp strings are equivalent to just [ and just ]. So I > think the current value is incorrect, and the [ needs to have \\ before it. > > Meanwhile, the question we're discussing here is whether to write \\ > before the ]. That is harmless, and the question is whether it makes > things clearer or more confusing. The problem is that usually it > makes things clearer, but occasionally people could get confused when > \\ is last in a character alternative. The question whether writing '\\' before the `]' is relevant for the example cited above. Usually, when I see a `\\]' outside a character alternative I expect it to match a right bracket in some text. And, usually, in that text a left bracket will precede the right bracket. Hence, if in the text above the author had used `\\]' instead of `\]' it would have been easy to conclude - from the absence of a preceding `\\[' - that something went wrong. Vice versa, when seeing a `\\[' I usually expect it to have a corresponding `\\]' somehwere on the right.