From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: Re: Regexp: match any character including newline Date: Thu, 17 Oct 2013 10:25:13 +0800 Message-ID: <87vc0wocqe.fsf@ericabrahamsen.net> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1381976684 24517 80.91.229.3 (17 Oct 2013 02:24:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 17 Oct 2013 02:24:44 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Oct 17 04:24:48 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VWdGZ-00069Q-Pz for geh-help-gnu-emacs@m.gmane.org; Thu, 17 Oct 2013 04:24:47 +0200 Original-Received: from localhost ([::1]:50008 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWdGZ-0003g5-CK for geh-help-gnu-emacs@m.gmane.org; Wed, 16 Oct 2013 22:24:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39907) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWdGJ-0003fV-4V for help-gnu-emacs@gnu.org; Wed, 16 Oct 2013 22:24:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VWdGB-0005vF-My for help-gnu-emacs@gnu.org; Wed, 16 Oct 2013 22:24:31 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:49309) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWdGB-0005v8-H4 for help-gnu-emacs@gnu.org; Wed, 16 Oct 2013 22:24:23 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VWdG6-000605-Jm for help-gnu-emacs@gnu.org; Thu, 17 Oct 2013 04:24:18 +0200 Original-Received: from 221.216.161.34 ([221.216.161.34]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 17 Oct 2013 04:24:18 +0200 Original-Received: from eric by 221.216.161.34 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 17 Oct 2013 04:24:18 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 35 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 221.216.161.34 User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:fojafNpiWr0o1ghFYOVj1CC11ZU= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:94052 Archived-At: Yuri Khan writes: > Hello All, > > I’m doing regexp replacements on a hard-wrapped XHTML-alike. Here’s an > original fragment: > > === >
X(n, t)
> X a(n, t)
>

T shall be > Copy­Insert­able into > X.

>

post: distance(begin(), end()) == n

>

Constructs a sequence container with n copies > of t

> === Another option (though I'm not claiming you'll actually want to do this) is to use xml.el (comes with emacs?) to parse that xml into a tree, and then mess with the tree. Parsing the above gets me: ((tr nil (td nil (pre nil (code nil "X(n, t) X a(n, t)"))) (td nil) " " (td nil (requires nil (p nil (code nil "T") " shall be " (concept nil "Copy?Insert?able") " into " (code nil "X") ".")) " " (p nil "post: " (code nil "distance(begin(), end()) == n")) " " (p nil "Constructs a sequence container with " (code nil "n") " copies of " (code nil "t"))))) `xml-entity-alist' would have to be tweaked. Like I said, you probably wouldn't want this, but it's an interesting option... E