From: Greg Ward Date: Wed, 7 May 2003 01:20:58 +0000 (+0000) Subject: SF #596434: tweak wordsep_re so the definition of an em-dash is X-Git-Tag: v2.3c1~822 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a409f7c491647fe0c256c944d6fe4e9593d15760;p=python SF #596434: tweak wordsep_re so the definition of an em-dash is stricter: specifically, "--" must be preceded by a limited set of characters, not by any non-whitespace character. --- diff --git a/Lib/textwrap.py b/Lib/textwrap.py index fdb95d7163..b0c7042b54 100644 --- a/Lib/textwrap.py +++ b/Lib/textwrap.py @@ -75,7 +75,7 @@ class TextWrapper: # (after stripping out empty strings). wordsep_re = re.compile(r'(\s+|' # any whitespace r'-*\w{2,}-(?=\w{2,})|' # hyphenated words - r'(?<=\S)-{2,}(?=\w))') # em-dash + r'(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w))') # em-dash # XXX will there be a locale-or-charset-aware version of # string.lowercase in 2.3?