Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

An xml based data format is by definition a subset of all valid xml. In particular it may be a regular subset.


I swapped out a "proper" parser for a regex parser for one particular thing we have at work that was too slow with the original parser. The format it is parsing is very simple, one top level tag, no nested keys, no comments, no attributes, or any other of the weird things you can do in XML. We needed to get the value of one particular tag in a potentially huge file. As far as I can tell this format has been unchanged for the past 25 years ... It took me 10 minutes to write the regex parser, and it sped up the execution by 10-100x. If the format changes unannounced tomorrow and it breaks this, we'll deal with it - until then, YAGNI




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: