2 ms·
Regular Expressions make me feel like a powerful wizard. That's not a good thing
- asicsp 4y ago>There's no space for comments Depending on the regex flavor, you can use the `x` flag or add inline comments with `(?#)`.
- edent 4y agoThat's interesting! Which flavours do that?
- asicsp 4y agoPython has `re.VERBOSE` (`re.X` is short form). PCRE, Rust `regex` crate, Ruby have `x` flag (possibly other flavors too) Last I checked, JavaScript doesn't have it. But, you can use normal string with comments: https://stackoverflow.com/q/15463257 https://stackoverflow.com/q/15463257 BRE/ERE don't have it.
- dusted 4y agoThey make me feel like a powerful lizard :P
- beardyw 4y agoI can imagine a kind of Typescript for RegEx. RegEx in a nice readable form which gets converted. How you would use it I can't imagine.
- NateEag 4y agoAs is so often the case, Emacs already has a mature implementation of this built-in: https://www.gnu.org/software/emacs/manual/html_node/elisp/Rx-Notation.html https://www.gnu.org/software/emacs/manual/html_node/elisp/Rx...