Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #18774

Unclear about verbose regex syntax (excaping whitespace)

From Roy Smith <roy@panix.com>
Newsgroups comp.lang.python
Subject Unclear about verbose regex syntax (excaping whitespace)
Date 2012-01-10 08:49 -0800
Organization http://groups.google.com
Message-ID <27946490.520.1326214183718.JavaMail.geo-discussion-forums@vbnm18> (permalink)

Show all headers | View raw


The docs for re.VERBOSE say, "Whitespace within the pattern is ignored, except when [...] preceded by an unescaped backslash".  It's unclear exactly what that means.  If my pattern is:

<backslash><space><space>

is the second space considered to be preceded by a backslash, and thus taken literally, or does the backslash only apply to the first <space>?  I suspect the latter, but it's somewhat ambiguous.

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Unclear about verbose regex syntax (excaping whitespace) Roy Smith <roy@panix.com> - 2012-01-10 08:49 -0800
  Re: Unclear about verbose regex syntax (excaping whitespace) Tim Chase <python.list@tim.thechases.com> - 2012-01-10 11:34 -0600

csiph-web