From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thr4wn Newsgroups: gmane.emacs.help Subject: Re: Regex Problem Date: Mon, 21 Jul 2008 14:47:00 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1216680054 23327 80.91.229.12 (21 Jul 2008 22:40:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 21 Jul 2008 22:40:54 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 22 00:41:42 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 1KL44Z-0001Sf-Li for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Jul 2008 00:41:39 +0200 Original-Received: from localhost ([127.0.0.1]:50460 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KL43g-0000z1-AS for geh-help-gnu-emacs@m.gmane.org; Mon, 21 Jul 2008 18:40:44 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!l64g2000hse.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 40 Original-NNTP-Posting-Host: 216.254.27.75 Original-X-Trace: posting.google.com 1216676820 32572 127.0.0.1 (21 Jul 2008 21:47:00 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Mon, 21 Jul 2008 21:47:00 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l64g2000hse.googlegroups.com; posting-host=216.254.27.75; posting-account=yciHbgoAAAC-yiSCERRTWUTnOnw8WIwj User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.14) Gecko/20080404 Iceweasel/2.0.0.14 (Debian-2.0.0.14-2), gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:160423 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:55771 Archived-At: On Jul 19, 1:50 pm, travis jeffery wrote: > I'm trying to write and extension for using tumbr. In tumblr there are two > requirements for a post; title and body. > > So I set up a tumblr post document as: > title: > body: > > So get the title I use (string-match "\\title: \(.*\)\$"), which is fine > because it's on a single line. But with I'm having trouble getting the body > because it's multiple lines. So is there someway I can get any text > following the body:_space_? I was thinking also of saving the entire buffer > and then subtracting the title: TITLE and body:_space_ but I still don't > know about that. > > Thanks for your help. > -- > View this message in context:http://www.nabble.com/Regex-Problem-tp18547090p18547090.html > Sent from the Emacs - Help mailing list archive at Nabble.com. 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 (honestly, I'm not exactly sure what the difference between ^J and ^M is. I think one is \n while the other is \r. Since Windows requires all lines to end with \r\n, I would allow for either ^J or ^M in the search). Also, \' means "end of buffer/string", so using both that knowledge, I think the following will work... "^body: ?\(\(.\|^J\|^M\)*\)\'" (there is a \' at the end of that string) Also, I am not certain if I understand why your regexp for title had \ \ at the beginning? wouldn't that match a literal backslash when you really want just the beginning of the line (^)? let me know if something I said didn't make sense. -Thr4wn