|
|
|
|
|
by cbuq
2767 days ago
|
|
There is a saying (which I can't remember the source) that I always thought described regex perfectly in my experience. "Beginner programmers don't understand regex, good programmers understand regex, the best programmers don't use regex." I've found regex is a poor choice in production systems because it is very hard to maintain (which this library tries to address) and very hard to test (which this library does not address). However, regex is perfect for that complicated one-time find and replace. |
|
Case in point: logfile analysis. Often times you might have a log file with many different kinds of messages formatted in many different ways, only some of which you care about. A quick regular expression can pull out the messages of interest, and extract out the bits you care about. Sure, in an ideal world you'd ingest the logging data in some structured format, but the real world simply does not hand you the luxury of controlling all your upstream data sources all the time.