4 ms·
Almost every RFC writes their grammars in some form of BNF not in regular expressions. RFC are written to be understandable. > Sure, you could make it more ve
by admax88q 6y ago
Almost every RFC writes their grammars in some form of BNF not in regular expressions. RFC are written to be understandable.
> Sure, you could make it more verbose, but that wouldn't make it easier to understand the whole of it, or why it is the way it is.
Absolutely it would. The way to understand a large thing, is to understand the smaller components and then put them together. Regular Expressions to do not compose well.
- Tainnor 6y ago> Regular Expressions to do not compose well. That is patently untrue. Regular expressions compose under a number of important mathematical operations, such as union, intersection and concatenation. If your PL supports string interpolation, it's trivial to compose them in these ways (well ok, maybe not intersection). Nobody says that your regex needs to be written as a single string.