From cce4d67fc466b902a6b553c731d7be700b506dfd Mon Sep 17 00:00:00 2001 From: Greg Ward Date: Thu, 22 Aug 2002 21:04:21 +0000 Subject: [PATCH] Fix SF bug #596434: tweak wordsep_re so "--foo-bar" now splits into /--foo-/bar/ rather than /--/foo-/bar/. Needed for Optik and Docutils to handle Unix-style command-line options properly. --- Lib/textwrap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/textwrap.py b/Lib/textwrap.py index fb8d3b841d4..8b3a26559a5 100644 --- a/Lib/textwrap.py +++ b/Lib/textwrap.py @@ -55,7 +55,7 @@ class TextWrapper: # Hello/ /there/ /--/ /you/ /goof-/ball,/ /use/ /the/ /-b/ /option! # (after stripping out empty strings). wordsep_re = re.compile(r'(\s+|' # any whitespace - r'\w{2,}-(?=\w{2,})|' # hyphenated words + r'-*\w{2,}-(?=\w{2,})|' # hyphenated words r'(?<=\w)-{2,}(?=\w))') # em-dash # XXX will there be a locale-or-charset-aware version of