From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: Re: How to grok a complicated regex? Date: Fri, 13 Mar 2015 22:45:10 +0100 Message-ID: <87h9toa7x5.fsf@wmi.amu.edu.pl> References: <87ioe4a8d3.fsf@wmi.amu.edu.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1426283154 8511 80.91.229.3 (13 Mar 2015 21:45:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 13 Mar 2015 21:45:54 +0000 (UTC) To: Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Mar 13 22:45:44 2015 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 1YWXOp-00071U-PU for geh-help-gnu-emacs@m.gmane.org; Fri, 13 Mar 2015 22:45:43 +0100 Original-Received: from localhost ([::1]:38773 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWXOo-0000S8-R8 for geh-help-gnu-emacs@m.gmane.org; Fri, 13 Mar 2015 17:45:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53338) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWXOR-0000Rx-6n for help-gnu-emacs@gnu.org; Fri, 13 Mar 2015 17:45:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YWXOL-0004YY-VI for help-gnu-emacs@gnu.org; Fri, 13 Mar 2015 17:45:19 -0400 Original-Received: from msg.wmi.amu.edu.pl ([2001:808:114:2::50]:46030) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWXOL-0004XO-OV for help-gnu-emacs@gnu.org; Fri, 13 Mar 2015 17:45:13 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by msg.wmi.amu.edu.pl (Postfix) with ESMTP id 5E1DA57E51 for ; Fri, 13 Mar 2015 22:45:11 +0100 (CET) Original-Received: from msg.wmi.amu.edu.pl ([127.0.0.1]) by localhost (msg.wmi.amu.edu.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SSuX0fM7g9aq for ; Fri, 13 Mar 2015 22:45:11 +0100 (CET) Original-Received: from localhost (117-116.echostar.pl [213.156.117.116]) by msg.wmi.amu.edu.pl (Postfix) with ESMTPSA id 1EBCC57E49 for ; Fri, 13 Mar 2015 22:45:11 +0100 (CET) In-reply-to: <87ioe4a8d3.fsf@wmi.amu.edu.pl> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:808:114:2::50 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:103148 Archived-At: On 2015-03-13, at 22:35, Marcin Borkowski wrote: > Hi all, > > so I have this monstrosity [note: I know, there are much worse ones, > too!]: > > "\\`\\(?:\\\\[([]\\|\\$+\\)?\\(.*?\\)\\(?:\\\\[])]\\|\\$+\\)?\\'" > > (it's in the org-latex--script-size function in ox-latex.el, if you're > curious). > > I'm not asking =E2=80=9Cwhat does this match=E2=80=9D =E2=80=93 I can r= ead it myself. But it > comes with a considerable effort. Are you aware of any tools that migh= t > help to understand such regexen? BTW, it turned out to be fairly simple after all, but I could see this only after passing it through (insert ...) in a temporary buffer, so that all the double backslashes stopped looking like a drunkard's nightmare. So even such a rudimentary "tool" (basically, temp buffer and `insert') did help a lot. Best, --=20 Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University