]> granicus.if.org Git - python/commitdiff
Tweak wordsep_re again: this time to recognize an em-dash with
authorGreg Ward <gward@python.net>
Thu, 22 Aug 2002 21:28:00 +0000 (21:28 +0000)
committerGreg Ward <gward@python.net>
Thu, 22 Aug 2002 21:28:00 +0000 (21:28 +0000)
any non-whitespace characters adjacent, not just \w.

Lib/textwrap.py

index 8b3a26559a57487771ed250aedb4d378821054c6..f5d1915711033707e2d48692259f5613b2dd1ec6 100644 (file)
@@ -56,7 +56,7 @@ class TextWrapper:
     # (after stripping out empty strings).
     wordsep_re = re.compile(r'(\s+|'                  # any whitespace
                             r'-*\w{2,}-(?=\w{2,})|'   # hyphenated words
-                            r'(?<=\w)-{2,}(?=\w))')   # em-dash
+                            r'(?<=\S)-{2,}(?=\S))')   # em-dash
 
     # XXX will there be a locale-or-charset-aware version of
     # string.lowercase in 2.3?