note: when giving an example that contains an evaluation of a story variable it helps if you also include an assignment of that story variable.
eg. Your example contained the following:
$string1 containing data such as "amekv8nw"
... but we don't know if $string has a value of exactly "amekv8nw" in which case using an is operator to do the comparison would be the better chose, or if the value of the variable is something like "zzzzzamekv8nwzzzzz" in which case the contains operator is the correct choice.
If I understand correctly you have a collection of String values which you want to search through looking for all elements that contain a particular sub-String, and then want to do something for each of the elements found.
So assuming your collection of values and your search term look something like the following:
(set: $collection to (a: "aaazz", "bbbzz", "ccccc", "dddzz", "eeeee"))
(set: $term to "zz")
... then you can use the (find: ) macro to collate a list of the elements that contained the term you were searching for:
(set: _found to (find: _value where _value contains $term, ...$collection))
... and then use the (for: ) macro to process each of the found elements:
(for: each _value, ..._found)[
warning: The timer created by the (live:) macro interferes with the Reader's ability to interact with the page each time it fires, which is why that macro is not a good method for looping through a collection.
It is a good idea when first using a particular story format that you give it's manual a quick read-through so that you have a basic understanding of what functionality it supports, this will help when trying to workout how to implement some feature of your story.