[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to grok a complicated regex?

From: Vaidheeswaran C
Subject: Re: How to grok a complicated regex?
Date: Mon, 23 Mar 2015 17:48:41 +0530
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.3.0

On Saturday 14 March 2015 03:05 AM, Marcin Borkowski wrote:
> "\\`\\(?:\\\\[([]\\|\\$+\\)?\\(.*?\\)\\(?:\\\\[])]\\|\\$+\\)?\\'"
> (it's in the org-latex--script-size function in ox-latex.el, if you're
> curious).
> I'm not asking “what does this match” – I can read it myself.  But it
> comes with a considerable effort.  Are you aware of any tools that might
> help to understand such regexen?

Get xr.el from;filename=xr.el;att=1;bug=13369

M-x load-library xr.el

M-x pp-eval-expression RET
(xr "\\`\\(?:\\\\[([]\\|\\$+\\)?\\(.*?\\)\\(?:\\\\[])]\\|\\$+\\)?\\'") RET

    (seq bos
           (seq "\\"
                (any "[" "("))
           (one-or-more "$")))
           (zero-or-more nonl)))
           (seq "\\"
                (any ")" "]"))
           (one-or-more "$")))

There is also lex (see which
provides similar functionality.  FWIW, my edit window "disappears" if
I do


reply via email to

[Prev in Thread] Current Thread [Next in Thread]