4 ms·
See also: Emacs' structured regexp notation, https://www.gnu.org/software/emacs/manual/html_node/elisp/Rx-Notation.html https://www.gnu.org/software/emacs/manua
by matthews2 4y ago
See also: Emacs' structured regexp notation, https://www.gnu.org/software/emacs/manual/html_node/elisp/Rx-Notation.html https://www.gnu.org/software/emacs/manual/html_node/elisp/Rx...
- cardanome 4y agoOh, I like that one! Very easy to read. Have you ever worked with it and what was you experience? I can see myself using that or even implement it for other languages.
- matthews2 4y agoIt can end up taking a little longer to write (same with all of these alternate syntaxes), but I think it significantly reduces the WTF-factor when you have to try and read it again in weeks/months/years. I think it's worth it for any non-trivial regexp and I miss it whenever I'm using any other language, so I'm glad that this thread is full of alternatives :)
- natrys 4y agoNot OP but I have switched to using rx macro for everything and I never miss regex. I miss rx instead everywhere else. Here are couple of blog posts someone might find useful: https://francismurillo.github.io/2017-03-30-Exploring-Emacs-rx-Macro/ https://francismurillo.github.io/2017-03-30-Exploring-Emacs-... https://karthinks.com/software/bridging-islands-in-emacs-1/ https://karthinks.com/software/bridging-islands-in-emacs-1/
- rcthompson 4y agoI haven't used rx in Elisp specifically, but in my work in R, I've started using the rex package almost exclusively for writing regexes. It's the same idea: you build a regex programmatically instead of as a string, so you no longer need to think about syntax, only semantics, because the syntax is the same as the host language.
- ur-whale 4y agoAside from the parens fetishism common to all lisp-flavored things, it is very nice and readable indeed.
- bjoli 4y agoOrr Irregex and it's more limited SRFI: http://synthcode.com/scheme/irregex/ http://synthcode.com/scheme/irregex/ https://srfi.schemers.org/srfi-115/srfi-115.html https://srfi.schemers.org/srfi-115/srfi-115.html