4 ms·
Regex are practical, you can use them from the command line, in your SQL statements, with your browser's JS engine, or on the server side - everywhere. A full S
by mojuba 17y ago
Regex are practical, you can use them from the command line, in your SQL statements, with your browser's JS engine, or on the server side - everywhere. A full Sexpr parser, on the other hand, is a more complicated machine not readily available everywhere. You don't have it in the UNIX userland by default, in SQL implementations, etc.
- prodigal_erik 17y agoStrings that look like text or markup may or may not be, depending on whether they are surrounded by comments, CDATA marked sections, or processing instructions. Most people who try this get it wrong, and end up with a tool that randomly fails on some documents. Getting it right requires a regex big enough to actually be an XML parser, and why write that from scratch rather than use one that's known to work (and understand well-formedness and namespaces as well)?