[Top][All Lists]

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

Re: How to grok a complicated regex?

From: Tassilo Horn
Subject: Re: How to grok a complicated regex?
Date: Thu, 19 Mar 2015 09:15:54 +0100
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)

Alan Mackenzie <> writes:

> I wrote myself the following tool.  It's not production quality, but
> you might find it useful nonetheless.  To use it, Type
>      M-: (pp-regexp re-horror).
> It displays the regexp at the end of the *scratch* buffer, dropping
> the contents of any \(..\) construct by one line.

Interesting idea, and it helps a bit.  What would be really cool was a
transformation from regexp to rx form.  Oh, and that seems to exist
already (available from Marmalade and MELPA)!


--8<---------------cut here---------------start------------->8---
;; Evals to...
(seq bos
     (\? (or (seq "\\" (any "[" "("))
             (+ "$")))
     (submatch (*\? nonl))
     (\? (or (seq "\\" (any ")" "]"))
             (+ "$")))
--8<---------------cut here---------------end--------------->8---


reply via email to

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