From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.bugs Subject: Re: \t not correctly processed in query-replace-regexp Date: Thu, 16 Sep 2004 17:27:07 +0200 Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <20040916114111.3F79E13F15@ws5-9.us4.outblaze.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1095348506 9973 80.91.229.6 (16 Sep 2004 15:28:26 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 16 Sep 2004 15:28:26 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 16 17:28:15 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1C7yBC-0008NL-00 for ; Thu, 16 Sep 2004 17:28:14 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C7yGs-0003W0-Nh for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 Sep 2004 11:34:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C7yGr-0003Vv-Id for bug-gnu-emacs@gnu.org; Thu, 16 Sep 2004 11:34:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C7yGp-0003Vj-U0 for bug-gnu-emacs@gnu.org; Thu, 16 Sep 2004 11:34:05 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C7yGp-0003VZ-OM for bug-gnu-emacs@gnu.org; Thu, 16 Sep 2004 11:34:03 -0400 Original-Received: from [195.135.220.2] (helo=Cantor.suse.de) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1C7yB6-0000kq-6u for bug-gnu-emacs@gnu.org; Thu, 16 Sep 2004 11:28:08 -0400 Original-Received: from hermes.suse.de (hermes-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 73168C0103A; Thu, 16 Sep 2004 17:27:08 +0200 (CEST) Original-To: "Paul vL" X-Yow: MY income is ALL disposable! In-Reply-To: <20040916114111.3F79E13F15@ws5-9.us4.outblaze.com> (Paul vL's message of "Thu, 16 Sep 2004 19:41:11 +0800") User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:9026 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:9026 "Paul vL" writes: > when using a character class with \t, the \t is not recognised: > [ \t]+ will not match a sequence of spaces and tabs. `[ \t]+' is a regexp that matches a sequence of SPC, backslash and `t'. > using C-q to insert a literal tab character does work; > [ ]+ will match a sequence of spaces and tabs. > > it is stated in the "syntax > of regular expressions" section of the emacs manual/info file that : > " `\"' stands for a double-quote as part of > the regexp, `\\' for a backslash as part of the regexp, `\t' for a tab, > and `\n' for a newline. " > and it even gives an example which uses \t for tabs: > "[.?!][]\"')]*\\($\\| $\\|\t\\| \\)[ \t\n]*" Here is the complete quote: In Lisp syntax, the string constant begins and ends with a double-quote. `\"' stands for a double-quote as part of the regexp, `\\' for a backslash as part of the regexp, `\t' for a tab, and `\n' for a newline. Note that it starts with "In Lisp syntax, the string constant ...", ie. the paragraph talks about string syntax in Lisp, not about regexp syntax. The Lisp reader transforms this string constant according to the quoted rules, and this transformed string is then interpreted by the regexp engine. The transformation of \t to TAB is only performed at the Lisp level. Andreas. --=20 Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux AG, Maxfeldstra=DFe 5, 90409 N=FCrnberg, Germany Key fingerprint =3D 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."