Calmcode - parse: findall

How the Parse findall method works.

1 2 3 4 5

There's one edge-case to still consider. What do we do if there's multiple strings that match to our format? Even if we use search we'll only find one match.

from parse import search

fmt = "{account}/{project}/"
txt = ""

# This only returns one result.
search(fmt, txt)

Instead, you'll want to use findall.

from parse import findall

fmt = "{account}/{project}/"
txt = ""
res = findall(fmt, txt)

# This returns two results