3 ms·
I think that regex is beautifully simple and communicates simple computations elegantly. The problem is that they are often not use for simple computations, an
by coreyp_1 4y ago
I think that regex is beautifully simple and communicates simple computations elegantly.
The problem is that they are often not use for simple computations, and therefore don't appear elegant.
They are, quite literally, like a flowchart. If it gets to be too big, then it gets difficult to understand without adding context to the parts (as some sibling comments have mentioned, by labeling the parts or by adding comments outside of the string definition).
Understanding Regex (and, by extension, DFAs) is very helpful, depending on your job. I used to teach Theory of Computing, and students would say "I'll never use this in the real world!", and yet only yesterday I was putting these very skills to use in my industry job in validating contract stipulations of a system.
I don't think it makes me feel like a powerful wizard... rather, I think I'm getting to spend time admiring a beautiful art exhibit!