Is there any way to combine groups and the * features of regular expressions to act kindof like a tokenizer / splitter. I tried this:
my_str = "foofoofoofoo"
pattern = "(foo)*"
result = re.search(pattern, my_str)
I was hoping my groups might look like
("foo", "foo", "foo", "foo")
But it does not. I was surprised by this because the ? and group features do work together:
my_str= "Mr foo"
pattern = "(Mr)? foo"
result = re.search(pattern, my_str)