3 ms·
Regular expressions
by wvenable 8y ago
Regular expressions
- ams6110 8y agoAnd sed, grep, and awk (though awk by itself can often do the job of the first two).
- yesenadam 8y agoYeah, I use AWK constantly, not just for reading files line by line, but whenever I need to e.g. create data in some format, like CSV or XML or for my programs, or to write repetitive code in a program or LaTeX file (e.g. for a lot of images) etc. It's just so quick and easy, such a versatile tool, a pleasure to use. I learnt sed and grep too but rarely use them.
- james_s_tayler 8y agoI only got into AWK much later than grep/sed but I was glad to discover some of awks power. Sed is still and will always my first love, but more and more I reach for awk to learn it as there is still so much I don't know.
- dwd 8y agoInvaluable for cleaning up raw data before it gets into the database.
- sparkie 8y agoI'd add that one should also learn LL and (G(LA))LR grammars. Regex are handy for quick hacks, but anything non-regular becomes hacky and overcomplicated compared with a self-describing grammar. PCREs are over-engineered. There seems to be an equivalent of the "NoSQL" crowd in parsing which appears to be "NoLALR". I can certainly see that other kinds of parsers have their use cases - but LL and LALR parsing have sound theory which is well understood, and they are certainly not obsolete.
- zzzcpan 8y agoThis is just an industry getting bigger, more people gain more experience and start to question all the dogmas. LR was taught dogmatically, but was never realistically any good or even useful in practice, hence "NoLALR" was born.