| ▲ | AussieWog93 2 hours ago | ||||||||||||||||||||||||||||
It might just be a me problem, but I've always been wary of regexes. They're not too bad to write, but reading them back and understanding what's actually going on can get a bit hairy. Plus, all of the subtle differences between regex libraries seems like a bit of a footgun. Obviously they have their place, but I know a lot of the older guys seemed to love them way more than the young. | |||||||||||||||||||||||||||||
| ▲ | bryanrasmussen 17 minutes ago | parent | next [-] | ||||||||||||||||||||||||||||
there is, I think, a divide between programmers that is pretty basic. Do they need a language that maps somewhat to written human language, or can they adapt to languages that do do not at all resemble the human languages they are familiar with. This divide is most probably cultural, programmers in Western societies often have pre-programming familiarity with English and thus they do not need to learn a language that does not match to how they understand languages to work (as might be the case with programmers from Asian countries or others where familiarity with English is not guaranteed) So if your primary gateway to programming languages are ones that slightly resemble a human language you are familiar with you may have lots of psychological blocks keeping you from making that final jump to reasoning in J, or APL, or even a DSL like regular expressions. Of course DSLs also have the problem that many programmers do not seem to fit well in things that do not have all the logical control operators they are used to, thus programmers who do not handle CSS, SQL or similar languages even though they are significantly simpler than a full featured programming language. In short, things that are very different from what you are used to will probably be difficult to learn, use, and remember, and the same goes for most of your coworkers. | |||||||||||||||||||||||||||||
| ▲ | rhdunn an hour ago | parent | prev [-] | ||||||||||||||||||||||||||||
Various libraries (e.g. Python's `re` library) support comments and whitespace as an option allowing you to format the regex on multiple lines with commenting to document what each part does. I'm not sure if there are any regex libraries that support DSLs and easy composability (e.g. the email RFC regex would be easier to read/maintain if you could specify the individual parts like are defined in the RFCs). | |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||