Re:How many errors?
by thaumasiotes on Tuesday September 08, 2015 @01:22AM
(#10184216)
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\"".
[ Parent
| on HN ]
Re:How many errors?
by thaumasiotes on Tuesday September 08, 2015 @03:25AM
(#10184420)
Actually, 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)\)*:(