mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
Tweak wordsep_re again: this time to recognize an em-dash with
any non-whitespace characters adjacent, not just \w.
This commit is contained in:
parent
c6edb37268
commit
e3bd104aa7
1 changed files with 1 additions and 1 deletions
|
|
@ -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?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue