Rim Chatti <chattir...@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 <rep...@bugs.python.org> <https://bugs.python.org/issue41259> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com