({{, (RefLink[Extract, paclet:ref/Extract])[expr,pos]
extracts the part of expr at the position specified by pos. }, {, (RefLink[Extract, paclet:ref/Extract])[expr,{(Subscript[pos, 1]),(Subscript[pos, 2]),…}]
extracts a list of parts of expr. }, {, (RefLink[Extract, paclet:ref/Extract])[expr,pos,h] 
extracts parts of expr, wrapping each of them with head h before evaluation. }, {, (RefLink[Extract, paclet:ref/Extract])[pos] 
represents an operator form of (RefLink[Extract, paclet:ref/Extract]) that can be applied to an expression.}})

OpenersNotesSection(Spacer1)Details

(RefLink[Extract, paclet:ref/Extract])[expr,{i,j,…}] is equivalent to (RefLink[Part, paclet:ref/Part])[expr,i,j,…].

The position specifications used by (RefLink[Extract, paclet:ref/Extract]) have the same form as those returned by (RefLink[Position, paclet:ref/Position]), and used in functions such as (RefLink[MapAt, paclet:ref/MapAt]) and (RefLink[ReplacePart, paclet:ref/ReplacePart]).

You can use (RefLink[Extract, paclet:ref/Extract])[expr,…,(RefLink[Hold, paclet:ref/Hold])] to extract parts without evaluation.

If expr is a (RefLink[SparseArray, paclet:ref/SparseArray]) object, (RefLink[Extract, paclet:ref/Extract])[expr,…] extracts parts in the corresponding ordinary array.

(RefLink[Extract, paclet:ref/Extract]) works on (RefLink[Association, paclet:ref/Association]) objects, using the same specification for keys as in (RefLink[Part, paclet:ref/Part]).

(RefLink[Extract, paclet:ref/Extract])[pos][expr] is equivalent to (RefLink[Extract, paclet:ref/Extract])[expr,pos].

OpenersPrimaryExamplesSection(Spacer1)Examples  (7)

OpenersExampleSection0(Spacer1)Basic Examples  (6)

Extract the second part from an expression:

Extract[{1,2,3,4},{2}]

Extract a part nested in an expression:

e = f[g[1,2],{h[3]}];

Extract[e,{1,2}]

Extract parts from multiple positions:

Extract[e,{{1,2},{2,1,1}}]

Extract the parts given by (RefLink[Position, paclet:ref/Position]):

e = f[g[1,2],{h[3]}];

p = Position[e,_Integer]

Extract[e,p]

Use an extract operator:

Extract[2][{a,b,c,d}]

Extract a part from an (RefLink[Association, paclet:ref/Association]):

Extract[<|1->1+x^2|>,{Key[1],2}]

Extract using different specifications:

Extract[<|1->1+x^2|>, {{1,2},{Key[1],2}}]

OpenersExampleSection1(Spacer1)Possible Issues  (1)

(RefLink[Extract, paclet:ref/Extract])[expr,{}] returns an empty list of subexpressions because the list of positions is empty:

Extract[h[a,b],{}]

(RefLink[Extract, paclet:ref/Extract])[expr,{{}}] extracts the subexpression at position {}, which is the whole expression:

Extract[h[a,b],{{}}]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Part, paclet:ref/Part])  ▪  (RefLink[Take, paclet:ref/Take])  ▪  (RefLink[PadLeft, paclet:ref/PadLeft])  ▪  (RefLink[ReplacePart, paclet:ref/ReplacePart])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Manipulating Lists by Their Indices, paclet:tutorial/ManipulatingListsByTheirIndices])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Parts of Matrices, paclet:guide/PartsOfMatrices])}, {▪(RefLinkPlain[Evaluation Control, paclet:guide/EvaluationControl])}, {▪(RefLinkPlain[Elements of Lists, paclet:guide/ElementsOfLists])}, {▪(RefLinkPlain[List Manipulation, paclet:guide/ListManipulation])}, {▪(RefLinkPlain[Function Composition & Operator Forms, paclet:guide/FunctionCompositionAndOperatorForms])}, {▪(RefLinkPlain[Parts of Expressions, paclet:guide/PartsOfExpressions])}})}})