The Python Oracle

How to find all occurrences of a substring?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Track title: CC D Schuberts Piano Sonata D 850 in D

--

Chapters
00:00 Question
00:44 Accepted answer (Score 740)
01:40 Answer 2 (Score 167)
02:09 Answer 3 (Score 76)
02:32 Answer 4 (Score 76)
02:51 Thank you

--

Full question
https://stackoverflow.com/questions/4664...

Question links:
[Count number of occurrences of a substring in a string]: https://stackoverflow.com/questions/8899...

Accepted answer links:
[regular expressions]: http://www.regular-expressions.info/
[lookahead]: http://www.regular-expressions.info/look...
[re.finditer]: http://docs.python.org/library/re.html#r...
[generator]: http://wiki.python.org/moin/Generators

Answer 3 links:
[re.finditer]: https://docs.python.org/3/library/re.htm...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #string

#avk47