DEV Community

Discussion on: How do you feel about regex?

Collapse
 
cess11 profile image
PNS11

For being terse it's surprisingly hard to read compared to other forms of computer programming line noise, like old Perl that runs on oak barrels and mules or everyday J.

Requiring visualisation tools to be somewhat interpretable outside the trivial case means one can't just skim it and be fairly confident about what it does, unlike the surrounding application code (hopefully).

If I can take the performance hit or development time I'll probably avoid regex if I can, usually it's possible to implement a parser that's easier to understand at a quick glance.

So I mostly use them in CLI settings, like patterns for ripgrep or sed.