From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jason Rumney Newsgroups: gmane.emacs.help Subject: Re: NTemacs: in NEGATED char-class, how to show newline? [^n]+ goes one too far. Date: Fri, 19 Feb 2010 07:47:02 -0800 (PST) Organization: http://groups.google.com Message-ID: <73098511-fa5b-4927-b1d4-59ce9e2a6055@t31g2000prh.googlegroups.com> References: <1d13f217-f3fb-41b6-8627-0f343812ae02@c34g2000pri.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1266597721 5175 80.91.229.12 (19 Feb 2010 16:42:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 19 Feb 2010 16:42:01 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Feb 19 17:41:59 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NiVvS-0003TM-FR for geh-help-gnu-emacs@m.gmane.org; Fri, 19 Feb 2010 17:41:58 +0100 Original-Received: from localhost ([127.0.0.1]:53965 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NiVvR-0005Ra-Nc for geh-help-gnu-emacs@m.gmane.org; Fri, 19 Feb 2010 11:41:57 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!postnews.google.com!t31g2000prh.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 26 Original-NNTP-Posting-Host: 202.87.221.133 Original-X-Trace: posting.google.com 1266594422 30500 127.0.0.1 (19 Feb 2010 15:47:02 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 19 Feb 2010 15:47:02 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: t31g2000prh.googlegroups.com; posting-host=202.87.221.133; posting-account=pYxWjwkAAACsHSUNDoi5N05LVCTP7PVM User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100214 Ubuntu/9.10 (karmic) Firefox/3.5.8,gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:176891 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:71959 Archived-At: On Feb 19, 11:40=A0pm, Jason Rumney wrote: > On Feb 18, 4:14=A0am, dkco...@panix.com (David Combs) wrote: > > > subj: NTemacs: in NEGATED char-class, how to show newline? =A0[^\n]+ go= es one too far. > > > Remember that this is "ntemacs" (google it, you'll see), running under > > WINDOWS xp, where line-ends are the old DEC crlf. > > Emacs uses LF line ends internally, converting on read and write > (unless you explicitly use binary or *-unix as your coding system). > > > (query-replace-regexp "[^\\n]+" =A0 =A0 "BEGIN--\\&--END" =A0 =A0 =A0ni= l (if (and transient-mark-mode mark-active) (region-beginning)) (if (and tr= ansient-mark-mode mark-active) (region-end))) > > Does the following work any better? > > (query-replace-regexp ".+$" "BEGIN--\\&--END" ...) Also, try M-x regexp-builder to see in real-time what your regexp will select. My guess is that there are no n or \ characters in your buffer, and you've escaped the backslash in a context where it doesn't need escaping.