From: Greg Ward Date: Thu, 22 Aug 2002 21:28:00 +0000 (+0000) Subject: Tweak wordsep_re again: this time to recognize an em-dash with X-Git-Tag: v2.3c1~4335 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e3bd104aa7d0f664914c1db9547db24ea86a7b48;p=thirdparty%2FPython%2Fcpython.git Tweak wordsep_re again: this time to recognize an em-dash with any non-whitespace characters adjacent, not just \w. --- diff --git a/Lib/textwrap.py b/Lib/textwrap.py index 8b3a26559a57..f5d191571103 100644 --- a/Lib/textwrap.py +++ b/Lib/textwrap.py @@ -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?