Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Core Language > Rules & Patterns > Rules > ReplaceList >

ReplaceList

ReplaceList
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
gives a list of at most n results.
  • When no transformation is possible, ReplaceList returns .
Give the results of all possible replacements:
Give only the first replacement that applies:
Give the results of all possible replacements:
In[1]:=
Click for copyable input
Out[1]=
Give only the first replacement that applies:
In[2]:=
Click for copyable input
Out[2]=
Use all rules that apply:
Use only the first rule:
Find the possible values to break a sum of terms in two:
Generate all subsets:
Find all elements that appear twice:
Find all sublists flanked by the same element:
New in 3
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF