4 ms·
No, that fails to address nearly all the use cases of escaping. Escaping is the difference between printf("\n") and printf("n"), or between printf("d") and prin
by thaumasiotes 11y ago
No, that fails to address nearly all the use cases of escaping. Escaping is the difference between printf("\n") and printf("n"), or between printf("d") and printf("%d"), or between (dog|cat)* (any number of repetitions of "dog" and "cat") and \(dog|cat\)* (a left paren, exactly one instance of "dog" or "cat", and any number of right parens). Those aren't differences of length. The only scenario marked length helps with is situations like "I need to use \"scare quotes\"".
- thaumasiotes 11y agoActually, I feel compelled to note that as written, \(dog|cat\)* doesn't do what I said; it matches stuff like this: (dog cat)))) cat What I said embarrassingly requires another set of non-escaped parens: \((dog|cat)\)* :(
- eru 11y agoGood point!