std::regex should throw std::regex_error if constructed with a pattern ending in a trailing backslash, since a trailing backlash is not a valid escape sequence.
This addresses bug #26175.
Differential D16262
[libc++] Treat trailing backslashes in a regex pattern as invalid. jpetrie on Jan 16 2016, 2:42 PM. Authored by
Details
std::regex should throw std::regex_error if constructed with a pattern ending in a trailing backslash, since a trailing backlash is not a valid escape sequence. This addresses bug #26175.
Diff Detail Event TimelineComment Actions This looks good to me. A quick search for \\ in regex didn't find any other obvious instances of this anti-pattern. For the record, the bug is https://llvm.org/bugs/show_bug.cgi?id=26175 Can you commit this yourself, or would you rather I did it? |