[Python-Dev] Re: [Python-checkins] python/dist/src/Lib warnings.py,1.19,1.20

Fred L. Drake, Jr. fdrake@acm.org
Thu, 15 May 2003 08:09:57 -0400


Guido van Rossum writes:
 > Agreed, but you're still using two levels of quoting, and with
 > anything less, "foo.bar" will also match a module named "foolbar".

Agreed.  "foo\.bar" will match "foolbar" as well, but 'foo\.bar' only
matches "foo.bar".  The advantage of single quotes is that you're not
escaping the escape characters with themselves; what's inside the
quotes is simple RE syntax, so you only need to think about one of the
layers at a time.

Either approach works, of course.


  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at acm.org>
PythonLabs at Zope Corporation