From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nikolaj Schumacher Newsgroups: gmane.emacs.help Subject: Re: Regex Problem Date: Tue, 22 Jul 2008 14:29:07 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1216729836 24812 80.91.229.12 (22 Jul 2008 12:30:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 22 Jul 2008 12:30:36 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Thr4wn Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 22 14:31:25 2008 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.50) id 1KLH1V-000556-9v for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Jul 2008 14:31:21 +0200 Original-Received: from localhost ([127.0.0.1]:47802 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KLH0b-0004aL-Vz for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Jul 2008 08:30:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KLGzu-0004Qu-0E for help-gnu-emacs@gnu.org; Tue, 22 Jul 2008 08:29:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KLGzs-0004QN-6N for help-gnu-emacs@gnu.org; Tue, 22 Jul 2008 08:29:41 -0400 Original-Received: from [199.232.76.173] (port=35789 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KLGzs-0004QK-15 for help-gnu-emacs@gnu.org; Tue, 22 Jul 2008 08:29:40 -0400 Original-Received: from fmmailgate02.web.de ([217.72.192.227]:53891) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KLGzr-0001pu-IU for help-gnu-emacs@gnu.org; Tue, 22 Jul 2008 08:29:39 -0400 Original-Received: from smtp05.web.de (fmsmtp05.dlan.cinetic.de [172.20.4.166]) by fmmailgate02.web.de (Postfix) with ESMTP id 55E80E6BE3AE; Tue, 22 Jul 2008 14:29:38 +0200 (CEST) Original-Received: from [136.199.55.225] (helo=aragorn.uni-trier.de) by smtp05.web.de with asmtp (WEB.DE 4.109 #226) id 1KLGzq-0000nk-00; Tue, 22 Jul 2008 14:29:38 +0200 In-Reply-To: (Thr4wn's message of "Mon\, 21 Jul 2008 14\:47\:00 -0700 \(PDT\)") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-Sender: n_schumacher@web.de X-Provags-ID: V01U2FsdGVkX1+gS4vNg7cX6AwEpkIUkra3dteqYfwDWYZM34RD 4gjnd6cjbv5+xjmeNt61FUYQHBDfqnTKAFBNlCWkGMx0lC6+gs BT9Bl1t6Ndk2yjIVFGrA== X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 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:55792 Archived-At: Thr4wn wrote: > In an emacs regexp, you can directly enter a newline character as a > possible match by hitting C-j (will appear as ^J in the regexp) and/or > C-q C-m You can, but you should most definitely not. It just makes the text hard to read or edit in anything other than Emacs. Just use \n. > Since Windows requires all lines to end with \r\n, I would allow for > either ^J or ^M in the search). I believe Emacs buffers will only contain \n even for Windows files. > On Jul 19, 1:50 pm, travis jeffery wrote: >> So I set up a tumblr post document as: >> title: >> body: >> >> So get the title I use (string-match "\\title: \(.*\)\$"), which is fine What do you mean by document? A file or a buffer? If so, why do you use string-match? You can just search around in the buffer, which should be more efficient. regards, Nikolaj Schumacher