I would like to find the positions of all the strings in the source text. The strings mark special positions in the source that need to be processed.
Perhaps that is the first case in your example, where finding the strings is enough.
I haven't realized index can be used like that, to find multiple matches. Or at least I imagined it would need more code than that. I'm going to use that solution now, instead of a regex.