3 ms·
>There's no space for comments Depending on the regex flavor, you can use the `x` flag or add inline comments with `(?#)`.
by 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.