[issue41259] Find adverbs is not correct on the documentation

2022-02-05 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue41259] Find adverbs is not correct on the documentation

2022-02-04 Thread Jacob Walls
Jacob Walls added the comment: Fixed in PR 21420, suggest closing as fixed. -- nosy: +jacobtylerwalls ___ Python tracker ___ ___ Py

[issue41259] Find adverbs is not correct on the documentation

2020-08-04 Thread Sagnik Mazumder
Sagnik Mazumder added the comment: fixed finding adverbs example in re docs -- message_count: 5.0 -> 6.0 nosy: +Sagnik Mazumder nosy_count: 6.0 -> 7.0 pull_requests: +20871 pull_request: https://github.com/python/cpython/pull/21728 ___ Python tracke

[issue41259] Find adverbs is not correct on the documentation

2020-07-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: I think it's fine as-is. The real purpose of the example is show basic patterns in writing regexes. Pig-latin examples or searching for words ending in -ly make for nice beginner examples. I like the OP's modification because it teaches a general skil

[issue41259] Find adverbs is not correct on the documentation

2020-07-09 Thread Peter Otten
Peter Otten <__pete...@web.de> added the comment: While I don't want to start a philosical discussion -- is that really better? Finding adverbs with a regex doesn't work in the general case -- think butterfly, panoply, well -- and the example is meant to illustrate the usage of re.findall() r

[issue41259] Find adverbs is not correct on the documentation

2020-07-09 Thread Rim Chatti
Rim Chatti 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= clear

[issue41259] Find adverbs is not correct on the documentation

2020-07-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: Please submit a PR. The parenthesis are not needed: re.findall(r"\b\w+ly\b", text) -- keywords: +easy nosy: +rhettinger versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.5 ___ Python tracker

[issue41259] Find adverbs is not correct on the documentation

2020-07-09 Thread Rim Chatti
Change by Rim Chatti : -- title: Find adverbs is not correct -> Find adverbs is not correct on the documentation ___ Python tracker ___ ___

[issue41259] Find adverbs is not correct

2020-07-09 Thread Rim Chatti
New submission from Rim Chatti : 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= c