4 ms·
I write regex all the time and I can't read a regex. It's a powerful tool and that's a very valid complaint about it.
by giraffe_lady 5y ago
I write regex all the time and I can't read a regex. It's a powerful tool and that's a very valid complaint about it.
- mistrial9 5y agoif my companion says "I am cold" on a warm day in the shade, then it is a valid complaint, since they probably do feel cold. You express empathy for the readers with "valid complaint" and from an educational, empathy point of view, sure, agree. Are regex's used by more people, or less people, than in 1999? Do people read, write and use them in code? for editing HTML pages? of course it is trivially true. That guy was saying to software developers "don't use regex it is a problem not a solution" .. I was there!
- tomc1985 5y agoPart of the fun of regex is learning to make sense of what looks like black magic I imagine asm programmers feel the same way fwiw I think this world needs less "it's too hard for me" and more "let me roll up my sleeves and dig into this"
- the_only_law 5y ago> fwiw I think this world needs less "it's too hard for me" and more "let me roll up my sleeves and dig into this" I’m gonna need a hell of a lot more of my time back for that.
- nocman 5y agoA regex can be difficult to parse, especially if it is very involved, but in Perl at least, there are ways to make it much easier ( using the /x modifier, for example : https://perldoc.perl.org/perlre#%2Fx-and-%2Fxx https://perldoc.perl.org/perlre#%2Fx-and-%2Fxx ). Comments and and having the regex itself be multiline can make things better, especially if you are creating a particularly complicated one. Damian Conway highly recommends using the combo of 'xms' his Perl Best Practices Book ( https://www.oreilly.com/library/view/perl-best-practices/0596001738/ https://www.oreilly.com/library/view/perl-best-practices/059... ). The revised and considerably newer "Modern Perl Best Practices" video series on O'Reilly's learning platform is particularly good also ( https://www.oreilly.com/library/view/modern-perl-best/9781491910719 https://www.oreilly.com/library/view/modern-perl-best/978149... ) - with lots of discussion of regexes.