StringReplaceList¶
Returns every single-replacement variant of a string.
Matches may overlap, since each result replaces exactly one of them:
A pattern rule contributes one result per span it can match — every length at every start position, longest first for a greedy pattern:
A list of rules is tried in its written order within each start position:
The third argument caps the number of results:
A replacement that is not a string keeps the result as a StringExpression:
A second argument that is not a replacement rule is refused, naming the last offending element: