[issue41259] Find adverbs is not correct on the documentation

Rim Chatti report at bugs.python.org
Thu Jul 9 15:08:45 EDT 2020


Rim Chatti <chattiriim at gmail.com> added the comment:

re.findall(r"\w+ly", text) does not find all adverbs in a sentence, it finds words that contain ly (not ending with ly) :
if text= 'andlying clearly', output: [andly, clearly]
which is wrong! 
the right way to do this is re.findall(r'\b\w+ly\b',text)
output= clearly!

----------
components: +Regular Expressions -Documentation
keywords: +patch
message_count: 2.0 -> 3.0
nosy: +ezio.melotti, mrabarnett
nosy_count: 3.0 -> 5.0
pull_requests: +20569
stage:  -> patch review
type:  -> behavior
pull_request: https://github.com/python/cpython/pull/21420

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41259>
_______________________________________


More information about the Python-bugs-list mailing list