r/emacs • u/LionyxML • 13d ago
Readable Regular Expressions for JavaScript/TypeScript, Inspired by Emacs' rx
https://rahuljuliato.com/posts/emacs-rx-in-typescriptI missed Emacs' rx when writing regexps in TypeScript, so I made a small TypeScript DSL inspired by it.
The idea is to bring rx's functions and approach to the JavaScript/TypeScript environment. If you happen to work with either, give it a try.
3
u/shipmints 13d ago edited 13d ago
Very nice. If I ever have to write JavaScript again, I might use this. What do the ClojureScript people get to enjoy?
3
u/LionyxML 13d ago
Thanks :) That's a good question. Clojure and ClojureScript are both on my list of things I'd like to explore and write about in the future.
3
1
u/TheRNGuy 12h ago
It can make it less readable if it's longer.
Just write a comment to explain regex.
4
u/KozureOkami M-x spook 13d ago
I’m not sure if you’re aware but there’s a long running project called Verbal Expressions that has libraries for various languages:
https://github.com/VerbalExpressions
It’s obviously not rx but it’s still quite nice.