ReplaceList
ReplaceList[expr,rules]
attempts to transform the entire expression expr by applying a rule or list of rules in all possible ways, and returns a list of the results obtained.
ReplaceList[expr,rules,n]
gives a list of at most n results.
ReplaceList[rules]
is an operator form of ReplaceList that can be applied to an expression.
Details

- When no transformation is possible, ReplaceList returns {}.
- ReplaceList[rules][expr] is equivalent to ReplaceList[expr,rules].
Examples
open allclose allBasic Examples (2)
Give the results of all possible replacements:
Give only the first replacement that applies:
Use ReplaceList in operator form:
Scope (2)
Applications (3)
Properties & Relations (1)
See Also
Replace ReplaceAll StringReplaceList Cases Trace Position Split
Tutorials
Related Guides
Related Links
Introduced in 1996
(3.0)
| Updated in 2018 (11.3)