From 7c59bc6f2faefbf8c4ef4692fee1f658aa53c6a6 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Sat, 13 Dec 2008 23:20:54 +0000 Subject: Issue #4163: textwrap module: allow word splitting on a hyphen preceded by a non-ASCII letter. --- Lib/textwrap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/textwrap.py') diff --git a/Lib/textwrap.py b/Lib/textwrap.py index 867b9d9f27..1f2e9b4a79 100644 --- a/Lib/textwrap.py +++ b/Lib/textwrap.py @@ -76,7 +76,7 @@ class TextWrapper: # (after stripping out empty strings). wordsep_re = re.compile( r'(\s+|' # any whitespace - r'[^\s\w]*\w+[a-zA-Z]-(?=\w+[a-zA-Z])|' # hyphenated words + r'[^\s\w]*\w+[^0-9\W]-(?=\w+[^0-9\W])|' # hyphenated words r'(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w))') # em-dash # This less funky little regex just split on recognized spaces. E.g. -- cgit v1.2.1