|
|
|
|
|
by nneonneo
2767 days ago
|
|
Like anything in programming, regular expressions are a tool. Yes, it might be unusually easy to shoot yourself in the foot with this particular tool, but that doesn't make them not valuable at all. I'd argue that the best programmers use them judiciously and cautiously, as they would any fancy language feature. 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. |
|