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:40:41 -0800 (PST) Organization: http://groups.google.com Message-ID: <1d13f217-f3fb-41b6-8627-0f343812ae02@c34g2000pri.googlegroups.com> References: 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 1266597665 4992 80.91.229.12 (19 Feb 2010 16:41:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 19 Feb 2010 16:41:05 +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:03 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 1NiVuT-0002Vh-JO for geh-help-gnu-emacs@m.gmane.org; Fri, 19 Feb 2010 17:40:58 +0100 Original-Received: from localhost ([127.0.0.1]:53421 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NiVuS-000555-Qo for geh-help-gnu-emacs@m.gmane.org; Fri, 19 Feb 2010 11:40:56 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!postnews.google.com!c34g2000pri.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 17 Original-NNTP-Posting-Host: 202.87.221.133 Original-X-Trace: posting.google.com 1266594041 27627 127.0.0.1 (19 Feb 2010 15:40:41 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 19 Feb 2010 15:40:41 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: c34g2000pri.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:176890 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:71958 Archived-At: On Feb 18, 4:14=A0am, dkco...@panix.com (David Combs) wrote: > subj: NTemacs: in NEGATED char-class, how to show newline? =A0[^\n]+ goes= 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 =A0nil = (if (and transient-mark-mode mark-active) (region-beginning)) (if (and tran= sient-mark-mode mark-active) (region-end))) Does the following work any better? (query-replace-regexp ".+$" "BEGIN--\\&--END" ...)