Page 1 of 1

Python: findall Function

Posted: Wed Aug 13, 2025 9:01 am
by The Jason
In this form, the findall function returns a list of instances of some phrase.

Code: Select all

import re

forum_name = "Hosting Chatter"

instances_of_word_host_in_forum_name = re.findall("host", forum_name)

print(instances_of_word_host_in_forum_name)

# The output will be 

# ['host'] 

# due to it occuring once.