I am going to match something from a string, and I want to put all the matched strings into a list; how would I do that?
Right now I am using this
myStr = 'one two one three'
match = re.match(r'one', myStr)
But when I print the content of variable match
using print m.group()
, it only displays the first occurrence. I want to get all the occurrences and then put all those values into a list.