[issue31856] Unexpected behavior of re module when VERBOSE flag is set

2017-10-23 Thread Bob Kline
Bob Kline added the comment: The light finally comes on. I actually *was* putting a backslash into the string value, with the raw flag (which is, of course, what you were trying to tell me). Thanks for your patience. :-) --

[issue31856] Unexpected behavior of re module when VERBOSE flag is set

2017-10-23 Thread Bob Kline
Bob Kline added the comment: I had been under the impression that "escaped" in this context meant that an escape character (the backslash) was part of the string value for the regular expression (there's a little bit of overloading going on with that word). Thanks for

[issue31856] Unexpected behavior of re module when VERBOSE flag is set

2017-10-23 Thread Matthew Barnett
Matthew Barnett added the comment: Your verbose examples put the pattern into raw triple-quoted strings, which is OK, but their first character is a backslash, which makes the next character (a newline) an escaped literal whitespace character. Escaped whitespace is

[issue31856] Unexpected behavior of re module when VERBOSE flag is set

2017-10-23 Thread Bob Kline
New submission from Bob Kline : According to the documentation of the re module, "When this flag [re.VERBOSE] has been specified, whitespace within the RE string is ignored, except when the whitespace is in a character class or preceded by an unescaped backslash; this